diff --git a/modules/system/boot/stage-2.nix b/modules/system/boot/stage-2.nix index 3569cfa8113..c8ea322eb17 100644 --- a/modules/system/boot/stage-2.nix +++ b/modules/system/boot/stage-2.nix @@ -1,53 +1,60 @@ { config, pkgs, ... }: +with pkgs.lib; + let options = { boot = { - postBootCommands = pkgs.lib.mkOption { + + postBootCommands = mkOption { default = ""; example = "rm -f /var/log/messages"; - type = with pkgs.lib.types; string; + type = types.string; description = '' Shell commands to be executed just before Upstart is started. ''; }; - devSize = pkgs.lib.mkOption { + devSize = mkOption { default = "5%"; example = "32m"; + type = types.uniq types.string; description = '' Size limit for the /dev tmpfs. Look at mount(8), tmpfs size option, for the accepted syntax. ''; }; - devShmSize = pkgs.lib.mkOption { + devShmSize = mkOption { default = "50%"; example = "256m"; + type = types.uniq types.string; description = '' Size limit for the /dev/shm tmpfs. Look at mount(8), tmpfs size option, for the accepted syntax. ''; }; - runSize = pkgs.lib.mkOption { + runSize = mkOption { default = "25%"; example = "256m"; + type = types.uniq types.string; description = '' Size limit for the /run tmpfs. Look at mount(8), tmpfs size option, for the accepted syntax. ''; }; - cleanTmpDir = pkgs.lib.mkOption { + cleanTmpDir = mkOption { default = false; example = true; description = '' Delete all files in /tmp/ during boot. ''; }; + }; }; @@ -66,7 +73,7 @@ let [ pkgs.coreutils pkgs.utillinux pkgs.sysvtools - ] ++ pkgs.lib.optional config.boot.cleanTmpDir pkgs.findutils; + ] ++ optional config.boot.cleanTmpDir pkgs.findutils; postBootCommands = pkgs.writeText "local-cmds" '' ${config.boot.postBootCommands}