3
0
Fork 0
forked from mirrors/nixpkgs

nixos/filesystems: faster nonEmtpyStr check

regexes should be faster than nix functions
This commit is contained in:
Jörg Thalheim 2020-08-14 07:25:07 +01:00
parent b8a19ca2bc
commit 19bf53f143
No known key found for this signature in database
GPG key ID: 003F2096411B5F92

View file

@ -8,7 +8,7 @@ let
addCheckDesc = desc: elemType: check: types.addCheck elemType check
// { description = "${elemType.description} (with check: ${desc})"; };
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);