nixos/filesystems: faster nonEmtpyStr check
regexes should be faster than nix functions
This commit is contained in:
parent
b8a19ca2bc
commit
19bf53f143
@ -8,7 +8,7 @@ let
|
|||||||
addCheckDesc = desc: elemType: check: types.addCheck elemType check
|
addCheckDesc = desc: elemType: check: types.addCheck elemType check
|
||||||
// { description = "${elemType.description} (with check: ${desc})"; };
|
// { description = "${elemType.description} (with check: ${desc})"; };
|
||||||
nonEmptyStr = addCheckDesc "non-empty" types.str
|
nonEmptyStr = addCheckDesc "non-empty" types.str
|
||||||
(x: x != "" && ! (all (c: c == " " || c == "\t") (stringToCharacters x)));
|
(s: (builtins.match ".*[^ \t]+.*" s) != null);
|
||||||
|
|
||||||
fileSystems' = toposort fsBefore (attrValues config.fileSystems);
|
fileSystems' = toposort fsBefore (attrValues config.fileSystems);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user