summary refs log tree commit diff
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2020-08-14 07:25:07 +0100
committerJörg Thalheim <joerg@thalheim.io>2020-12-30 07:50:30 +0100
commit19bf53f143040b87d39538e265ccc0933d7c1929 (patch)
tree32a4ea6f79577fae637cc6e1b3e7321d17280d22
parentb8a19ca2bcff1de182bc7d161afe54de8985b31f (diff)
downloadnixpkgs-19bf53f143040b87d39538e265ccc0933d7c1929.tar
nixpkgs-19bf53f143040b87d39538e265ccc0933d7c1929.tar.gz
nixpkgs-19bf53f143040b87d39538e265ccc0933d7c1929.tar.bz2
nixpkgs-19bf53f143040b87d39538e265ccc0933d7c1929.tar.lz
nixpkgs-19bf53f143040b87d39538e265ccc0933d7c1929.tar.xz
nixpkgs-19bf53f143040b87d39538e265ccc0933d7c1929.tar.zst
nixpkgs-19bf53f143040b87d39538e265ccc0933d7c1929.zip
nixos/filesystems: faster nonEmtpyStr check
regexes should be faster than nix functions
-rw-r--r--nixos/modules/tasks/filesystems.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/modules/tasks/filesystems.nix b/nixos/modules/tasks/filesystems.nix
index a055072f9c9..96f57fc80b0 100644
--- a/nixos/modules/tasks/filesystems.nix
+++ b/nixos/modules/tasks/filesystems.nix
@@ -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);