From 3b6931cba855ca188c234c811c777ee0442a6b75 Mon Sep 17 00:00:00 2001 From: Adam Roper Date: Thu, 19 Dec 2024 21:42:37 -0500 Subject: [PATCH] feat: add spiceproxy --- modules/proxmox-ve/manager.nix | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/modules/proxmox-ve/manager.nix b/modules/proxmox-ve/manager.nix index 3deadf2..800aed2 100644 --- a/modules/proxmox-ve/manager.nix +++ b/modules/proxmox-ve/manager.nix @@ -169,7 +169,27 @@ lib.mkIf cfg.enable { # }; # }; - # spiceproxy = { }; + spiceproxy = { + description = "PVE SPICE Proxy Server"; + wantedBy = [ "multi-user.target" ]; + after = [ "pveproxy.service" ]; + wants = [ "pveproxy.service" ]; + serviceConfig = { + ExecStartPre = [ + "${pkgs.coreutils}/bin/touch /var/lock/spiceproxy.lck" + "${pkgs.coreutils}/bin/chown www-data:www-data /var/lock/spiceproxy.lck" + ]; + ExecStart = "${pkgs.proxmox-ve}/bin/spiceproxy start"; + ExecStop = [ + "${pkgs.coreutils}/bin/rm -f /var/lock/spiceproxy.lck" + "${pkgs.proxmox-ve}/bin/spiceproxy stop" + ]; + ExecReload = "${pkgs.proxmox-ve}/bin/spiceproxy restart"; + PIDFile = "/run/pveproxy/spiceproxy.pid"; # the code puts it here, not in /run/spiceproxy/ + Type = "forking"; + Restart = "on-failure"; + }; + }; }; systemd.tmpfiles.rules = [ "d /var/log/pveproxy 0755 www-data www-data -" ];