Merge pull request #186536 from tpwrules/add-spice-webdavd-module
nixos/spice-webdavd: init
This commit is contained in:
commit
6c36827e98
3 changed files with 44 additions and 0 deletions
|
@ -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
|
||||
|
|
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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -44,6 +44,11 @@ stdenv.mkDerivation rec {
|
|||
|
||||
outputs = [ "out" "dev" "lib" ];
|
||||
|
||||
# We need to do this in pre-configure before the data/ folder disappears.
|
||||
preConfigure = ''
|
||||
install -vDt $out/lib/udev/rules.d/ data/*-spice-webdavd.rules
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "WebDav server implementation and library using libsoup";
|
||||
homepage = "https://wiki.gnome.org/phodav";
|
||||
|
|
Loading…
Reference in a new issue