about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSandro Jäckel <sandro.jaeckel@gmail.com>2024-06-11 00:10:09 +0200
committerSandro Jäckel <sandro.jaeckel@gmail.com>2024-06-11 00:10:09 +0200
commitdec5ef74b0e913d87f4bf1ab5f02622f9b9292e9 (patch)
treebc59f7881005d286f68d525656aedac9c8fae6d4
parentd2943a89bb6699bab2493d7d4ef7dac6745cab37 (diff)
nixos/locate: only set LOCATE_PATH for findutils locate
For plocate/mlocate it causes the results to be printed twice.
-rw-r--r--nixos/modules/misc/locate.nix4
1 files changed, 3 insertions, 1 deletions
diff --git a/nixos/modules/misc/locate.nix b/nixos/modules/misc/locate.nix
index 84c711c2b4efa..bca350b4bf62b 100644
--- a/nixos/modules/misc/locate.nix
+++ b/nixos/modules/misc/locate.nix
@@ -227,7 +227,9 @@ in
 
     environment.systemPackages = [ cfg.package ];
 
-    environment.variables.LOCATE_PATH = cfg.output;
+    environment.variables = lib.mkIf isFindutils {
+      LOCATE_PATH = cfg.output;
+    };
 
     environment.etc = {
       # write /etc/updatedb.conf for manual calls to `updatedb`