nixos.system.boot.kernel: stronger constraints for kernelParam type

Checks whether all spaces are inside double quotes, thus ensuring that one
string parses as no more than one kernel param.

Co-authored-by: pennae <82953136+pennae@users.noreply.github.com>
This commit is contained in:
Vladimir Serov
2021-10-16 01:21:10 +03:00
co-authored by pennae
parent f38ee4de53
commit a868222d65
+4 -1
View File
@@ -83,7 +83,10 @@ in
};
boot.kernelParams = mkOption {
type = types.listOf types.str;
type = types.listOf (types.strMatching ''([^"[:space:]]|"[^"]*")+'' // {
name = "kernelParam";
description = "string, with spaces inside double quotes";
});
default = [ ];
description = "Parameters added to the kernel command line.";
};