nixos/spice-webdavd: init
This commit is contained in:
parent
f6e0ba1baf
commit
9c52987b51
2 changed files with 39 additions and 0 deletions
|
@ -637,6 +637,7 @@
|
||||||
./services/misc/sonarr.nix
|
./services/misc/sonarr.nix
|
||||||
./services/misc/sourcehut
|
./services/misc/sourcehut
|
||||||
./services/misc/spice-vdagentd.nix
|
./services/misc/spice-vdagentd.nix
|
||||||
|
./services/misc/spice-webdavd.nix
|
||||||
./services/misc/ssm-agent.nix
|
./services/misc/ssm-agent.nix
|
||||||
./services/misc/sssd.nix
|
./services/misc/sssd.nix
|
||||||
./services/misc/subsonic.nix
|
./services/misc/subsonic.nix
|
||||||
|
|
38
nixos/modules/services/misc/spice-webdavd.nix
Normal file
38
nixos/modules/services/misc/spice-webdavd.nix
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.services.spice-webdavd;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options = {
|
||||||
|
services.spice-webdavd = {
|
||||||
|
enable = mkEnableOption "the spice guest webdav proxy daemon";
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
default = pkgs.phodav;
|
||||||
|
defaultText = literalExpression "pkgs.phodav";
|
||||||
|
type = types.package;
|
||||||
|
description = "spice-webdavd provider package to use.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
# ensure the webdav fs this exposes can actually be mounted
|
||||||
|
services.davfs2.enable = true;
|
||||||
|
|
||||||
|
# add the udev rule which starts the proxy when the spice socket is present
|
||||||
|
services.udev.packages = [ cfg.package ];
|
||||||
|
|
||||||
|
systemd.services.spice-webdavd = {
|
||||||
|
description = "spice-webdav proxy daemon";
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "simple";
|
||||||
|
ExecStart = "${cfg.package}/bin/spice-webdavd -p 9843";
|
||||||
|
Restart = "on-success";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue