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).
This commit is contained in:
Alyssa Ross 2022-03-15 11:27:37 +00:00
parent d2c95bb666
commit a65930ca21
No known key found for this signature in database
GPG key ID: F9DBED4859B271C0

View file

@ -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
'';