2011-07-24 23:36:30 +00:00
|
|
|
{ config, pkgs, ... }:
|
2009-01-02 16:07:30 +00:00
|
|
|
|
|
|
|
let
|
2009-05-27 23:14:38 +00:00
|
|
|
|
|
|
|
options = {
|
|
|
|
|
2010-04-17 15:20:13 +00:00
|
|
|
boot = {
|
|
|
|
postBootCommands = pkgs.lib.mkOption {
|
|
|
|
default = "";
|
|
|
|
example = "rm -f /var/log/messages";
|
2011-12-29 00:51:35 +00:00
|
|
|
type = with pkgs.lib.types; string;
|
2010-04-17 15:20:13 +00:00
|
|
|
description = ''
|
|
|
|
Shell commands to be executed just before Upstart is started.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
devSize = pkgs.lib.mkOption {
|
|
|
|
default = "50%";
|
|
|
|
example = "32m";
|
|
|
|
description = ''
|
|
|
|
Size limit for the /dev tmpfs. Look at mount(8), tmpfs size option,
|
|
|
|
for the accepted syntax.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
devShmSize = pkgs.lib.mkOption {
|
|
|
|
default = "50%";
|
|
|
|
example = "256m";
|
|
|
|
description = ''
|
|
|
|
Size limit for the /dev/shm tmpfs. Look at mount(8), tmpfs size option,
|
|
|
|
for the accepted syntax.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2011-09-13 18:49:47 +00:00
|
|
|
runSize = pkgs.lib.mkOption {
|
|
|
|
default = "50%";
|
|
|
|
example = "256m";
|
|
|
|
description = ''
|
|
|
|
Size limit for the /run tmpfs. Look at mount(8), tmpfs size option,
|
|
|
|
for the accepted syntax.
|
|
|
|
'';
|
|
|
|
};
|
2009-05-27 23:14:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2009-01-02 16:07:30 +00:00
|
|
|
kernel = config.boot.kernelPackages.kernel;
|
|
|
|
activateConfiguration = config.system.activationScripts.script;
|
|
|
|
|
2011-07-24 23:36:30 +00:00
|
|
|
bootStage2 = pkgs.substituteAll {
|
2009-05-25 14:19:33 +00:00
|
|
|
src = ./stage-2-init.sh;
|
2012-03-11 22:43:37 +00:00
|
|
|
shellDebug = "${pkgs.bashInteractive}/bin/bash";
|
2009-01-02 16:07:30 +00:00
|
|
|
isExecutable = true;
|
2011-09-13 18:49:47 +00:00
|
|
|
inherit (config.boot) devShmSize runSize;
|
2010-01-09 14:23:20 +00:00
|
|
|
ttyGid = config.ids.gids.tty;
|
2009-11-06 10:43:38 +00:00
|
|
|
upstart = config.system.build.upstart;
|
2009-06-05 16:02:58 +00:00
|
|
|
path =
|
2011-07-24 23:36:30 +00:00
|
|
|
[ pkgs.coreutils
|
|
|
|
pkgs.utillinux
|
|
|
|
pkgs.udev
|
|
|
|
pkgs.sysvtools
|
2009-06-05 16:02:58 +00:00
|
|
|
];
|
2011-07-24 23:36:30 +00:00
|
|
|
postBootCommands = pkgs.writeText "local-cmds"
|
2009-11-15 12:56:40 +00:00
|
|
|
''
|
|
|
|
${config.boot.postBootCommands}
|
|
|
|
${config.powerManagement.powerUpCommands}
|
|
|
|
'';
|
2009-01-02 16:07:30 +00:00
|
|
|
};
|
2011-09-13 18:49:50 +00:00
|
|
|
|
2009-01-02 16:07:30 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
{
|
2009-05-27 23:14:38 +00:00
|
|
|
require = [options];
|
2009-01-02 16:07:30 +00:00
|
|
|
|
2009-06-05 13:24:23 +00:00
|
|
|
system.build.bootStage2 = bootStage2;
|
2006-11-04 00:01:13 +00:00
|
|
|
}
|