nixpkgs/modules/system/boot/stage-2.nix
Eelco Dolstra 0a0260514d * Renamed boot.localCommands to boot.postBootCommands since it wasn't
such a good name (local to what?).

svn path=/nixos/branches/modular-nixos/; revision=15879
2009-06-05 16:02:58 +00:00

51 lines
1.0 KiB
Nix

{pkgs, config, ...}:
let
options = {
boot.postBootCommands = pkgs.lib.mkOption {
default = "";
example = "rm -f /var/log/messages";
merge = pkgs.lib.mergeStringOption;
description = ''
Shell commands to be executed just before Upstart is started.
'';
};
};
inherit (pkgs) substituteAll writeText coreutils utillinux udev upstart;
kernel = config.boot.kernelPackages.kernel;
activateConfiguration = config.system.activationScripts.script;
# Path for Upstart jobs. Should be quite minimal.
upstartPath =
[ pkgs.coreutils
pkgs.findutils
pkgs.gnugrep
pkgs.gnused
pkgs.upstart
];
bootStage2 = substituteAll {
src = ./stage-2-init.sh;
isExecutable = true;
inherit kernel upstart activateConfiguration upstartPath;
path =
[ coreutils
utillinux
udev
upstart
];
postBootCommands = writeText "local-cmds" config.boot.postBootCommands;
};
in
{
require = [options];
system.build.bootStage2 = bootStage2;
}