summary refs log tree commit diff
path: root/nixos/modules/services/misc/disnix.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/services/misc/disnix.nix')
-rw-r--r--nixos/modules/services/misc/disnix.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/nixos/modules/services/misc/disnix.nix b/nixos/modules/services/misc/disnix.nix
index c439efe9f8e7..0534c4fc942d 100644
--- a/nixos/modules/services/misc/disnix.nix
+++ b/nixos/modules/services/misc/disnix.nix
@@ -121,6 +121,7 @@ in
       disnix =
         { description = "Disnix server";
         
+          wants = [ "dysnomia.target" ];
           wantedBy = [ "multi-user.target" ];
           after = [ "dbus.service" ]
             ++ optional config.services.httpd.enable "httpd.service"
@@ -137,6 +138,17 @@ in
           environment = {
             HOME = "/root";
           };
+          
+          preStart = ''
+            mkdir -p /etc/systemd-mutable/system
+            if [ ! -f /etc/systemd-mutable/system/dysnomia.target ]
+            then
+                ( echo "[Unit]"
+                  echo "Description=Services that are activated and deactivated by Dysnomia"
+                  echo "After=final.target"
+                ) > /etc/systemd-mutable/system/dysnomia.target
+            fi
+          '';
 
           exec = "disnix-service";
         };