Merge pull request #8036 from Profpatsch/locate
locate: option includeStore
This commit is contained in:
commit
fa7860f84d
|
@ -179,6 +179,15 @@ nix-env -f "<nixpkgs>" -iA haskellPackages.cabal-install
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</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>
|
</itemizedlist>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
|
|
@ -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
|
###### implementation
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
|
||||||
systemd.services.update-locatedb =
|
systemd.services.update-locatedb =
|
||||||
{ description = "Update Locate Database";
|
{ description = "Update Locate Database";
|
||||||
path = [ pkgs.su ];
|
path = [ pkgs.su ];
|
||||||
|
@ -72,6 +79,7 @@ in {
|
||||||
mkdir -m 0755 -p $(dirname ${toString cfg.output})
|
mkdir -m 0755 -p $(dirname ${toString cfg.output})
|
||||||
exec updatedb \
|
exec updatedb \
|
||||||
--localuser=${cfg.localuser} \
|
--localuser=${cfg.localuser} \
|
||||||
|
${optionalString (!cfg.includeStore) "--prunepaths='/nix/store'"} \
|
||||||
--output=${toString cfg.output} ${concatStringsSep " " cfg.extraFlags}
|
--output=${toString cfg.output} ${concatStringsSep " " cfg.extraFlags}
|
||||||
'';
|
'';
|
||||||
serviceConfig.Nice = 19;
|
serviceConfig.Nice = 19;
|
||||||
|
|
Loading…
Reference in a new issue