diff --git a/system/options.nix b/system/options.nix index 1689b45f414..8db9703c09b 100644 --- a/system/options.nix +++ b/system/options.nix @@ -1534,6 +1534,16 @@ in default = false; description = "Whether to enable Disnix"; }; + + activateHook = mkOption { + default = ""; + description = "Custom script or executable that activates services through Disnix"; + }; + + deactivateHook = mkOption { + default = ""; + description = "Custom script or executable that deactivates services through Disnix"; + }; }; httpd = { diff --git a/upstart-jobs/disnix.nix b/upstart-jobs/disnix.nix index a952f5beab1..706b9d14d76 100644 --- a/upstart-jobs/disnix.nix +++ b/upstart-jobs/disnix.nix @@ -19,6 +19,6 @@ in sleep 3 end script - respawn ${pkgs.bash}/bin/sh -c 'export PATH=/var/run/current-system/sw/bin:$PATH; export HOME=/root; ${pkgs.disnix}/bin/disnix-service' + respawn ${pkgs.bash}/bin/sh -c 'export PATH=/var/run/current-system/sw/bin:$PATH; export HOME=/root; export DISNIX_ACTIVATE=${cfg.activateHook}; export DISNIX_DEACTIVATE_HOOK=${cfg.deactivateHook}; ${pkgs.disnix}/bin/disnix-service' ''; }