From c5fea583e296b40fb05b8b1a4216d18dc0e4e7f4 Mon Sep 17 00:00:00 2001 From: Sander van der Burg Date: Tue, 12 Aug 2008 13:16:12 +0000 Subject: [PATCH] Added disnix hook options svn path=/nixos/trunk/; revision=12596 --- system/options.nix | 10 ++++++++++ upstart-jobs/disnix.nix | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) 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' ''; }