diff --git a/lib/modules/partition.nix b/lib/modules/partition.nix index f0995d6f..3859716e 100644 --- a/lib/modules/partition.nix +++ b/lib/modules/partition.nix @@ -131,7 +131,7 @@ order = mkOption { type = types.int; 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 { @@ -147,8 +147,9 @@ }; size = mkOption { - type = types.str; + type = types.nullOr types.str; description = "The size of the partition."; + default = null; }; sizeScript = mkOption { @@ -170,7 +171,7 @@ then ''echo "$(cat /proc/meminfo | awk -F " " '/^MemTotal/ { print $2 }' | awk '{ print int((($1 / 1024 / 1024) * 0.75) + 0.5)}')"G'' else - "echo ${lib.strings.escapeShellArg config.size}" + "echo ${lib.strings.escapeShellArg (toString config.size)}" ); }; }