Set uniqueness constraint on boot.devShmSize etc.

This commit is contained in:
Eelco Dolstra 2012-10-23 07:50:23 -04:00
parent 7efde0740e
commit e5fa3f108e
1 changed files with 14 additions and 7 deletions

View File

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