diff options
author | ckie <25263210+ckiee@users.noreply.github.com> | 2022-08-17 13:41:43 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-17 13:41:43 +0300 |
commit | 6c36827e98e1fbe84ba8b6334bd63452d323b4f9 (patch) | |
tree | b88e0bc40038354f453d9eeb53de9d3ab5c0cbd9 /nixos | |
parent | 4b3b52974bfd4bf3ab76f87a1ebdc0312f374e6b (diff) | |
parent | 9c52987b51dc3af5dade4dcaa04a3b0ff0bd1d0a (diff) | |
download | nixlib-6c36827e98e1fbe84ba8b6334bd63452d323b4f9.tar nixlib-6c36827e98e1fbe84ba8b6334bd63452d323b4f9.tar.gz nixlib-6c36827e98e1fbe84ba8b6334bd63452d323b4f9.tar.bz2 nixlib-6c36827e98e1fbe84ba8b6334bd63452d323b4f9.tar.lz nixlib-6c36827e98e1fbe84ba8b6334bd63452d323b4f9.tar.xz nixlib-6c36827e98e1fbe84ba8b6334bd63452d323b4f9.tar.zst nixlib-6c36827e98e1fbe84ba8b6334bd63452d323b4f9.zip |
Merge pull request #186536 from tpwrules/add-spice-webdavd-module
nixos/spice-webdavd: init
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/module-list.nix | 1 | ||||
-rw-r--r-- | nixos/modules/services/misc/spice-webdavd.nix | 38 |
2 files changed, 39 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 3a849fcfec77..8a8df700330e 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -639,6 +639,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 diff --git a/nixos/modules/services/misc/spice-webdavd.nix b/nixos/modules/services/misc/spice-webdavd.nix new file mode 100644 index 000000000000..bfb5b262ee1a --- /dev/null +++ b/nixos/modules/services/misc/spice-webdavd.nix @@ -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"; + }; + }; + }; +} |