1 { config, lib, pkgs, ... }:
3 cfg = config.services.xe-guest-utilities;
6 services.xe-guest-utilities = {
7 enable = lib.mkEnableOption "the Xen guest utilities daemon";
10 config = lib.mkIf cfg.enable {
11 services.udev.packages = [ pkgs.xe-guest-utilities ];
12 systemd.tmpfiles.rules = [ "d /run/xenstored 0755 - - -" ];
14 systemd.services.xe-daemon = {
15 description = "xen daemon file";
16 wantedBy = [ "multi-user.target" ];
17 after = [ "xe-linux-distribution.service" ];
18 requires = [ "proc-xen.mount" ];
19 path = [ pkgs.coreutils pkgs.iproute2 ];
21 PIDFile = "/run/xe-daemon.pid";
22 ExecStart = "${pkgs.xe-guest-utilities}/bin/xe-daemon -p /run/xe-daemon.pid";
23 ExecStop = "${pkgs.procps}/bin/pkill -TERM -F /run/xe-daemon.pid";
27 systemd.services.xe-linux-distribution = {
28 description = "xen linux distribution service";
29 wantedBy = [ "multi-user.target" ];
30 before = [ "xend.service" ];
31 path = [ pkgs.xe-guest-utilities pkgs.coreutils pkgs.gawk pkgs.gnused ];
34 RemainAfterExit = "yes";
35 ExecStart = "${pkgs.xe-guest-utilities}/bin/xe-linux-distribution /var/cache/xe-linux-distribution";
40 { description = "Mount /proc/xen files";
45 ConditionPathExists = "/proc/xen";
46 RefuseManualStop = "true";