Added disnix service

svn path=/nixos/trunk/; revision=12283
This commit is contained in:
Sander van der Burg 2008-07-06 18:34:19 +00:00
parent 6df19e0cbb
commit 82ddadc27c
2 changed files with 33 additions and 1 deletions

View File

@ -350,7 +350,9 @@ let
inherit (pkgs) stdenv dbus;
dbusServices =
pkgs.lib.optional (config.services.hal.enable) pkgs.hal ++
pkgs.lib.optional (config.services.avahi.enable) pkgs.avahi;
pkgs.lib.optional (config.services.avahi.enable) pkgs.avahi ++
pkgs.lib.optional (config.services.disnix.enable) pkgs.disnix
;
})
# HAL daemon.
@ -401,6 +403,12 @@ let
inherit config pkgs;
})
# Disnix server
++ optional config.services.disnix.enable
(import ../upstart-jobs/disnix.nix {
inherit config pkgs;
})
# Handles the reboot/halt events.
++ (map
(event: makeJob (import ../upstart-jobs/halt.nix {

24
upstart-jobs/disnix.nix Normal file
View File

@ -0,0 +1,24 @@
args: with args;
let
cfg = config.services.disnix;
in
{
name = "disnix";
job = ''
description "Disnix server"
start on dbus
stop on shutdown
start script
# !!! quick hack: wait until dbus has started
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'
'';
}