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

View file

@ -26,13 +26,13 @@ let
# hostnames in its config file, then it will never do
# anything ever again ("couldn't resolve ..., giving up on
# 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
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
'';

View file

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

View file

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

View file

@ -14,8 +14,8 @@ let
xserver_arguments ${dmcfg.xserverArgs}
sessions ${pkgs.lib.concatStringsSep "," (dmcfg.session.names ++ ["custom"])}
login_cmd exec ${pkgs.stdenv.bash}/bin/sh ${dmcfg.session.script} "%session"
halt_cmd ${pkgs.upstart}/sbin/shutdown -h now
reboot_cmd ${pkgs.upstart}/sbin/shutdown -r now
halt_cmd ${config.system.build.upstart}/sbin/shutdown -h now
reboot_cmd ${config.system.build.upstart}/sbin/shutdown -r now
${if cfg.defaultUser != "" then "default_user " + cfg.defaultUser 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.build.etc}/etc $out/etc
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 "$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
childCount=0;
@ -113,7 +113,7 @@ let
pkgs.gnugrep
pkgs.findutils
pkgs.diffutils
pkgs.upstart # for initctl
config.system.build.upstart # for initctl
];
# 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;
activateConfiguration = config.system.activationScripts.script;
upstart = config.system.build.upstart;
# Path for Upstart jobs. Should be quite minimal.
upstartPath =
@ -25,7 +26,7 @@ let
pkgs.findutils
pkgs.gnugrep
pkgs.gnused
pkgs.upstart
upstart
];
bootStage2 = substituteAll {

View file

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