nixos/spice-webdavd: init

This commit is contained in:
Thomas Watson 2022-08-13 17:41:12 -05:00
parent f6e0ba1baf
commit 9c52987b51
2 changed files with 39 additions and 0 deletions

View file

@ -637,6 +637,7 @@
./services/misc/sonarr.nix
./services/misc/sourcehut
./services/misc/spice-vdagentd.nix
./services/misc/spice-webdavd.nix
./services/misc/ssm-agent.nix
./services/misc/sssd.nix
./services/misc/subsonic.nix

View 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";
};
};
};
}