1{ config, pkgs, lib, ... }:
2
3with lib;
4let
5 cfg = config.services.spice-vdagentd;
6in
7{
8 options = {
9 services.spice-vdagentd = {
10 enable = mkEnableOption "Spice guest vdagent daemon";
11 };
12 };
13
14 config = mkIf cfg.enable {
15
16 environment.systemPackages = [ pkgs.spice-vdagent ];
17
18 systemd.services.spice-vdagentd = {
19 description = "spice-vdagent daemon";
20 wantedBy = [ "graphical.target" ];
21 preStart = ''
22 mkdir -p "/var/run/spice-vdagentd/"
23 '';
24 serviceConfig = {
25 Type = "forking";
26 ExecStart = "${pkgs.spice-vdagent}/bin/spice-vdagentd";
27 };
28 };
29 };
30}