From a744aa74aa693a76193dd412c826b1190735551a Mon Sep 17 00:00:00 2001 From: Sander van der Burg Date: Thu, 26 Nov 2015 17:21:19 +0000 Subject: [PATCH] disnix: add a target for services activated and deactivated by dysnomia --- nixos/modules/services/misc/disnix.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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"; };