about summary refs log tree commit diff
path: root/nixos/modules/misc/locate.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-03-15 11:27:37 +0000
committerAlyssa Ross <hi@alyssa.is>2022-03-16 11:06:38 +0000
commita65930ca21b15feb290edf3f88d210f81c964322 (patch)
tree110f46399691eedc1b9d1fd11414d48e0a3905af /nixos/modules/misc/locate.nix
parentd2c95bb666145ccb28e376db9c8911aef38529bd (diff)
nixos/locate: disable default findutils pruneNames
It doesn't make sense to have a default value for this that's
incompatible with the default locate implementation.  It means that
just doing services.locate.enable = true; generates a warning, even if
you don't care about pruning anything.  So only use the default prune
list if the locate implementation supports it (i.e., isn't findutils).
Diffstat (limited to 'nixos/modules/misc/locate.nix')
-rw-r--r--nixos/modules/misc/locate.nix6
1 files changed, 5 insertions, 1 deletions
diff --git a/nixos/modules/misc/locate.nix b/nixos/modules/misc/locate.nix
index 66a49b0b888f2..204a891430082 100644
--- a/nixos/modules/misc/locate.nix
+++ b/nixos/modules/misc/locate.nix
@@ -183,7 +183,11 @@ in
 
     pruneNames = mkOption {
       type = listOf str;
-      default = [ ".bzr" ".cache" ".git" ".hg" ".svn" ];
+      default = lib.optionals (!isFindutils) [ ".bzr" ".cache" ".git" ".hg" ".svn" ];
+      defaultText = literalDocBook ''
+        <literal>[ ".bzr" ".cache" ".git" ".hg" ".svn" ]</literal>, if
+        supported by the locate implementation (i.e. mlocate or plocate).
+      '';
       description = ''
         Directory components which should exclude paths containing them from indexing
       '';