* Define the Upstart package to use in one place.

svn path=/nixos/branches/upstart-0.6/; revision=18187
This commit is contained in:
Eelco Dolstra 2009-11-06 09:36:35 +00:00
parent 5fc4590ce5
commit b581a56d79
8 changed files with 23 additions and 15 deletions

View File

@ -10,6 +10,7 @@ let
requiredPackages = requiredPackages =
[ config.system.sbin.modprobe # must take precedence over module_init_tools [ config.system.sbin.modprobe # must take precedence over module_init_tools
config.system.sbin.mount # must take precedence over util-linux config.system.sbin.mount # must take precedence over util-linux
config.system.build.upstart
config.environment.nix config.environment.nix
pkgs.acl pkgs.acl
pkgs.attr pkgs.attr
@ -53,7 +54,6 @@ let
pkgs.sysvtools pkgs.sysvtools
pkgs.time pkgs.time
pkgs.udev pkgs.udev
pkgs.upstart
pkgs.usbutils pkgs.usbutils
pkgs.utillinux pkgs.utillinux
]; ];

View File

@ -26,13 +26,13 @@ let
# hostnames in its config file, then it will never do # hostnames in its config file, then it will never do
# anything ever again ("couldn't resolve ..., giving up on # anything ever again ("couldn't resolve ..., giving up on
# it"), so we silently lose time synchronisation. # it"), so we silently lose time synchronisation.
${pkgs.upstart}/sbin/initctl stop ntpd ${config.system.build.upstart}/sbin/initctl stop ntpd
${pkgs.upstart}/sbin/initctl emit ip-up ${config.system.build.upstart}/sbin/initctl emit ip-up
fi fi
if test "$reason" = EXPIRE -o "$reason" = RELEASE; then if test "$reason" = EXPIRE -o "$reason" = RELEASE; then
${pkgs.upstart}/sbin/initctl emit ip-down ${config.system.build.upstart}/sbin/initctl emit ip-down
fi fi
''; '';

View File

@ -6,10 +6,12 @@ let
cfg = config.services.gw6c; cfg = config.services.gw6c;
# !!! Move this from the services tree to the nixos tree.
gw6cService = import (servicesPath + /gw6c) { gw6cService = import (servicesPath + /gw6c) {
inherit (pkgs) stdenv gw6c coreutils inherit (pkgs) stdenv gw6c coreutils
procps upstart iputils gnused procps iputils gnused
gnugrep seccure writeScript; gnugrep seccure writeScript;
upstart = config.system.build.upstart;
username = cfg.username; username = cfg.username;
password = cfg.password; password = cfg.password;
server = cfg.server; server = cfg.server;

View File

@ -12,8 +12,8 @@ let
defaultConfig = defaultConfig =
'' ''
[Shutdown] [Shutdown]
HaltCmd=${pkgs.upstart}/sbin/halt HaltCmd=${config.system.build.upstart}/sbin/halt
RebootCmd=${pkgs.upstart}/sbin/reboot RebootCmd=${config.system.build.upstart}/sbin/reboot
${optionalString (config.system.boot.loader.id == "grub") '' ${optionalString (config.system.boot.loader.id == "grub") ''
BootManager=Grub BootManager=Grub
''} ''}

View File

@ -14,8 +14,8 @@ let
xserver_arguments ${dmcfg.xserverArgs} xserver_arguments ${dmcfg.xserverArgs}
sessions ${pkgs.lib.concatStringsSep "," (dmcfg.session.names ++ ["custom"])} sessions ${pkgs.lib.concatStringsSep "," (dmcfg.session.names ++ ["custom"])}
login_cmd exec ${pkgs.stdenv.bash}/bin/sh ${dmcfg.session.script} "%session" login_cmd exec ${pkgs.stdenv.bash}/bin/sh ${dmcfg.session.script} "%session"
halt_cmd ${pkgs.upstart}/sbin/shutdown -h now halt_cmd ${config.system.build.upstart}/sbin/shutdown -h now
reboot_cmd ${pkgs.upstart}/sbin/shutdown -r now reboot_cmd ${config.system.build.upstart}/sbin/shutdown -r now
${if cfg.defaultUser != "" then "default_user " + cfg.defaultUser else ""} ${if cfg.defaultUser != "" then "default_user " + cfg.defaultUser else ""}
${if cfg.hideCursor then "hidecursor true" else ""} ${if cfg.hideCursor then "hidecursor true" else ""}
''; '';

View File

@ -75,11 +75,11 @@ let
ln -s ${config.system.activationScripts.script} $out/activate ln -s ${config.system.activationScripts.script} $out/activate
ln -s ${config.system.build.etc}/etc $out/etc ln -s ${config.system.build.etc}/etc $out/etc
ln -s ${config.system.path} $out/sw ln -s ${config.system.path} $out/sw
ln -s ${pkgs.upstart} $out/upstart ln -s ${config.system.build.upstart} $out/upstart
echo "$kernelParams" > $out/kernel-params echo "$kernelParams" > $out/kernel-params
echo "$configurationName" > $out/configuration-name echo "$configurationName" > $out/configuration-name
echo "${toString pkgs.upstart.interfaceVersion}" > $out/upstart-interface-version echo "${toString config.system.build.upstart.interfaceVersion}" > $out/upstart-interface-version
mkdir $out/fine-tune mkdir $out/fine-tune
childCount=0; childCount=0;
@ -113,7 +113,7 @@ let
pkgs.gnugrep pkgs.gnugrep
pkgs.findutils pkgs.findutils
pkgs.diffutils pkgs.diffutils
pkgs.upstart # for initctl config.system.build.upstart # for initctl
]; ];
# Boot loaders # Boot loaders

View File

@ -15,9 +15,10 @@ let
}; };
inherit (pkgs) substituteAll writeText coreutils utillinux udev upstart; inherit (pkgs) substituteAll writeText coreutils utillinux udev;
kernel = config.boot.kernelPackages.kernel; kernel = config.boot.kernelPackages.kernel;
activateConfiguration = config.system.activationScripts.script; activateConfiguration = config.system.activationScripts.script;
upstart = config.system.build.upstart;
# Path for Upstart jobs. Should be quite minimal. # Path for Upstart jobs. Should be quite minimal.
upstartPath = upstartPath =
@ -25,7 +26,7 @@ let
pkgs.findutils pkgs.findutils
pkgs.gnugrep pkgs.gnugrep
pkgs.gnused pkgs.gnused
pkgs.upstart upstart
]; ];
bootStage2 = substituteAll { bootStage2 = substituteAll {

View File

@ -4,6 +4,9 @@ with pkgs.lib;
let let
upstart = pkgs.upstart;
# From a job description, generate an Upstart job file. # From a job description, generate an Upstart job file.
makeJob = job: makeJob = job:
@ -75,7 +78,7 @@ let
jobs = jobs =
[pkgs.upstart] # for the built-in logd job [ upstart ] # for the built-in logd job
++ map (job: job.upstartPkg) (attrValues config.jobs); ++ map (job: job.upstartPkg) (attrValues config.jobs);
@ -278,6 +281,8 @@ in
config = { config = {
system.build.upstart = upstart;
environment.etc = environment.etc =
[ { # The Upstart events defined above. [ { # The Upstart events defined above.
source = "${jobsDir}/etc/event.d"; source = "${jobsDir}/etc/event.d";