From 19bf53f143040b87d39538e265ccc0933d7c1929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 14 Aug 2020 07:25:07 +0100 Subject: [PATCH] nixos/filesystems: faster nonEmtpyStr check regexes should be faster than nix functions --- nixos/modules/tasks/filesystems.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);