summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorlethalman <lucabru@src.gnome.org>2015-08-03 10:23:30 +0200
committerlethalman <lucabru@src.gnome.org>2015-08-03 10:23:30 +0200
commitfa7860f84d2018889588fcb32a4117d34634fc7d (patch)
tree6374839213feb4f37757332e3df790fc608bf8f4 /nixos
parentc6f5bb57853b2fde80b733744a3eabee6aa686ef (diff)
parent8c652379df07f88d6b434fe1042e9a9ba9078440 (diff)
downloadnixlib-fa7860f84d2018889588fcb32a4117d34634fc7d.tar
nixlib-fa7860f84d2018889588fcb32a4117d34634fc7d.tar.gz
nixlib-fa7860f84d2018889588fcb32a4117d34634fc7d.tar.bz2
nixlib-fa7860f84d2018889588fcb32a4117d34634fc7d.tar.lz
nixlib-fa7860f84d2018889588fcb32a4117d34634fc7d.tar.xz
nixlib-fa7860f84d2018889588fcb32a4117d34634fc7d.tar.zst
nixlib-fa7860f84d2018889588fcb32a4117d34634fc7d.zip
Merge pull request #8036 from Profpatsch/locate
locate: option includeStore
Diffstat (limited to 'nixos')
-rw-r--r--nixos/doc/manual/release-notes/rl-unstable.xml9
-rw-r--r--nixos/modules/misc/locate.nix10
2 files changed, 18 insertions, 1 deletions
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 &quot;&lt;nixpkgs&gt;&quot; -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>
 
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;