Make partition size nullable
This commit is contained in:
parent
a233064815
commit
dc4bcb4d22
1 changed files with 4 additions and 3 deletions
|
@ -131,7 +131,7 @@
|
||||||
order = mkOption {
|
order = mkOption {
|
||||||
type = types.int;
|
type = types.int;
|
||||||
description = "The sort order of the partition creation.";
|
description = "The sort order of the partition creation.";
|
||||||
default = if (!isSwap) && ((builtins.match ".*[^[:space:]].*" config.size) == null) then 1 else 0;
|
default = if (!isSwap) && ((builtins.match ".*[^[:space:]].*" (toString config.size)) == null) then 1 else 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
label = mkOption {
|
label = mkOption {
|
||||||
|
@ -147,8 +147,9 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
size = mkOption {
|
size = mkOption {
|
||||||
type = types.str;
|
type = types.nullOr types.str;
|
||||||
description = "The size of the partition.";
|
description = "The size of the partition.";
|
||||||
|
default = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
sizeScript = mkOption {
|
sizeScript = mkOption {
|
||||||
|
@ -170,7 +171,7 @@
|
||||||
then
|
then
|
||||||
''echo "$(cat /proc/meminfo | awk -F " " '/^MemTotal/ { print $2 }' | awk '{ print int((($1 / 1024 / 1024) * 0.75) + 0.5)}')"G''
|
''echo "$(cat /proc/meminfo | awk -F " " '/^MemTotal/ { print $2 }' | awk '{ print int((($1 / 1024 / 1024) * 0.75) + 0.5)}')"G''
|
||||||
else
|
else
|
||||||
"echo ${lib.strings.escapeShellArg config.size}"
|
"echo ${lib.strings.escapeShellArg (toString config.size)}"
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue