diff options
author | Sander van der Burg <svanderburg@gmail.com> | 2015-11-26 17:21:19 +0000 |
---|---|---|
committer | Sander van der Burg <svanderburg@gmail.com> | 2015-11-26 17:21:19 +0000 |
commit | a744aa74aa693a76193dd412c826b1190735551a (patch) | |
tree | 5ad8291c8d98cc26bedf344e4001ca214ee63354 /nixos | |
parent | 67e03d0c50f275b030f305de1215ee576f10b045 (diff) |
disnix: add a target for services activated and deactivated by dysnomia
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/misc/disnix.nix | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/nixos/modules/services/misc/disnix.nix b/nixos/modules/services/misc/disnix.nix index c439efe9f8e72..0534c4fc942d9 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"; }; |