locate: option includeStore

This commit is contained in:
Profpatsch 2015-05-28 12:18:31 +02:00
parent 479a43cf74
commit 8c652379df
2 changed files with 18 additions and 1 deletions

View File

@ -179,6 +179,15 @@ nix-env -f "<nixpkgs>" -iA haskellPackages.cabal-install
</para>
</listitem>
<listitem>
<para>
The <literal>locate</literal> service no longer indexes the nix store
by default, preventing packages with potentially numerous versions from
cluttering the output. Indexing the store can be activated with
<literal>services.locate.includeStore = true;</literal>.
</para>
</listitem>
</itemizedlist>
</para>

View File

@ -56,6 +56,14 @@ in {
'';
};
includeStore = mkOption {
type = types.bool;
default = false;
description = ''
Whether to include /nix/store in the locate database.
'';
};
};
};
@ -63,7 +71,6 @@ in {
###### implementation
config = {
systemd.services.update-locatedb =
{ description = "Update Locate Database";
path = [ pkgs.su ];
@ -72,6 +79,7 @@ in {
mkdir -m 0755 -p $(dirname ${toString cfg.output})
exec updatedb \
--localuser=${cfg.localuser} \
${optionalString (!cfg.includeStore) "--prunepaths='/nix/store'"} \
--output=${toString cfg.output} ${concatStringsSep " " cfg.extraFlags}
'';
serviceConfig.Nice = 19;