Merge pull request #186536 from tpwrules/add-spice-webdavd-module

nixos/spice-webdavd: init
This commit is contained in:
ckie 2022-08-17 13:41:43 +03:00 committed by GitHub
commit 6c36827e98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 44 additions and 0 deletions

View File

@ -639,6 +639,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

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

View File

@ -44,6 +44,11 @@ stdenv.mkDerivation rec {
outputs = [ "out" "dev" "lib" ]; 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; { meta = with lib; {
description = "WebDav server implementation and library using libsoup"; description = "WebDav server implementation and library using libsoup";
homepage = "https://wiki.gnome.org/phodav"; homepage = "https://wiki.gnome.org/phodav";