2014-04-14 14:26:48 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
2009-01-02 16:07:30 +00:00
|
|
|
|
2014-04-14 14:26:48 +00:00
|
|
|
with lib;
|
2012-10-23 11:50:23 +00:00
|
|
|
|
2009-01-02 16:07:30 +00:00
|
|
|
let
|
2009-05-27 23:14:38 +00:00
|
|
|
|
2013-09-04 11:05:09 +00:00
|
|
|
bootStage2 = pkgs.substituteAll {
|
|
|
|
src = ./stage-2-init.sh;
|
|
|
|
shellDebug = "${pkgs.bashInteractive}/bin/bash";
|
2018-03-01 19:03:41 +00:00
|
|
|
shell = "${pkgs.bash}/bin/bash";
|
2013-09-04 11:05:09 +00:00
|
|
|
isExecutable = true;
|
|
|
|
inherit (config.nix) readOnlyStore;
|
2014-04-18 14:40:27 +00:00
|
|
|
inherit (config.networking) useHostResolvConf;
|
2016-08-27 10:29:38 +00:00
|
|
|
inherit (config.system.build) earlyMountScript;
|
2017-04-04 21:27:51 +00:00
|
|
|
path = lib.makeBinPath [
|
2017-04-04 20:50:48 +00:00
|
|
|
pkgs.coreutils
|
|
|
|
pkgs.utillinux
|
|
|
|
pkgs.openresolv
|
2017-04-04 21:27:51 +00:00
|
|
|
];
|
2018-08-22 01:39:27 +00:00
|
|
|
fsPackagesPath = lib.makeBinPath config.system.fsPackages;
|
2013-09-04 11:05:09 +00:00
|
|
|
postBootCommands = pkgs.writeText "local-cmds"
|
|
|
|
''
|
|
|
|
${config.boot.postBootCommands}
|
|
|
|
${config.powerManagement.powerUpCommands}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
2009-05-27 23:14:38 +00:00
|
|
|
options = {
|
|
|
|
|
2010-04-17 15:20:13 +00:00
|
|
|
boot = {
|
2012-10-23 11:50:23 +00:00
|
|
|
|
|
|
|
postBootCommands = mkOption {
|
2010-04-17 15:20:13 +00:00
|
|
|
default = "";
|
|
|
|
example = "rm -f /var/log/messages";
|
2013-10-30 16:37:45 +00:00
|
|
|
type = types.lines;
|
2010-04-17 15:20:13 +00:00
|
|
|
description = ''
|
2013-01-21 23:14:09 +00:00
|
|
|
Shell commands to be executed just before systemd is started.
|
2010-04-17 15:20:13 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2012-10-23 11:50:23 +00:00
|
|
|
devSize = mkOption {
|
2012-05-17 19:33:12 +00:00
|
|
|
default = "5%";
|
2010-04-17 15:20:13 +00:00
|
|
|
example = "32m";
|
2013-10-30 10:02:04 +00:00
|
|
|
type = types.str;
|
2010-04-17 15:20:13 +00:00
|
|
|
description = ''
|
|
|
|
Size limit for the /dev tmpfs. Look at mount(8), tmpfs size option,
|
|
|
|
for the accepted syntax.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2012-10-23 11:50:23 +00:00
|
|
|
devShmSize = mkOption {
|
2010-04-17 15:20:13 +00:00
|
|
|
default = "50%";
|
|
|
|
example = "256m";
|
2013-10-30 10:02:04 +00:00
|
|
|
type = types.str;
|
2010-04-17 15:20:13 +00:00
|
|
|
description = ''
|
|
|
|
Size limit for the /dev/shm tmpfs. Look at mount(8), tmpfs size option,
|
|
|
|
for the accepted syntax.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2012-10-23 11:50:23 +00:00
|
|
|
runSize = mkOption {
|
2012-05-17 19:33:12 +00:00
|
|
|
default = "25%";
|
2011-09-13 18:49:47 +00:00
|
|
|
example = "256m";
|
2013-10-30 10:02:04 +00:00
|
|
|
type = types.str;
|
2011-09-13 18:49:47 +00:00
|
|
|
description = ''
|
|
|
|
Size limit for the /run tmpfs. Look at mount(8), tmpfs size option,
|
|
|
|
for the accepted syntax.
|
|
|
|
'';
|
|
|
|
};
|
2012-06-11 07:05:11 +00:00
|
|
|
|
2009-05-27 23:14:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2009-01-02 16:07:30 +00:00
|
|
|
|
2013-09-04 11:05:09 +00:00
|
|
|
config = {
|
2013-03-08 00:00:21 +00:00
|
|
|
|
2013-09-04 11:05:09 +00:00
|
|
|
system.build.bootStage2 = bootStage2;
|
2009-01-02 16:07:30 +00:00
|
|
|
|
2013-09-04 11:05:09 +00:00
|
|
|
};
|
2006-11-04 00:01:13 +00:00
|
|
|
}
|