summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2015-05-28 12:18:31 +0200
committerProfpatsch <mail@profpatsch.de>2015-08-02 01:04:13 +0200
commit8c652379df07f88d6b434fe1042e9a9ba9078440 (patch)
tree17321ebfe0b726a81f68a148c39850ad40840e1d /nixos/modules
parent479a43cf74bc37267dbb7e57931e7e745b2aa061 (diff)
downloadnixlib-8c652379df07f88d6b434fe1042e9a9ba9078440.tar
nixlib-8c652379df07f88d6b434fe1042e9a9ba9078440.tar.gz
nixlib-8c652379df07f88d6b434fe1042e9a9ba9078440.tar.bz2
nixlib-8c652379df07f88d6b434fe1042e9a9ba9078440.tar.lz
nixlib-8c652379df07f88d6b434fe1042e9a9ba9078440.tar.xz
nixlib-8c652379df07f88d6b434fe1042e9a9ba9078440.tar.zst
nixlib-8c652379df07f88d6b434fe1042e9a9ba9078440.zip
locate: option includeStore
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/misc/locate.nix10
1 files changed, 9 insertions, 1 deletions
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;