From 8c652379df07f88d6b434fe1042e9a9ba9078440 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Thu, 28 May 2015 12:18:31 +0200 Subject: locate: option includeStore --- nixos/doc/manual/release-notes/rl-unstable.xml | 9 +++++++++ nixos/modules/misc/locate.nix | 10 +++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'nixos') diff --git a/nixos/doc/manual/release-notes/rl-unstable.xml b/nixos/doc/manual/release-notes/rl-unstable.xml index abfd417c53a7..7106690b82b0 100644 --- a/nixos/doc/manual/release-notes/rl-unstable.xml +++ b/nixos/doc/manual/release-notes/rl-unstable.xml @@ -179,6 +179,15 @@ nix-env -f "<nixpkgs>" -iA haskellPackages.cabal-install + + + The locate 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 + services.locate.includeStore = true;. + + + diff --git a/nixos/modules/misc/locate.nix b/nixos/modules/misc/locate.nix index f3ed2aaba09d..bf05c4607295 100644 --- a/nixos/modules/misc/locate.nix +++ b/nixos/modules/misc/locate.nix @@ -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; -- cgit 1.4.1