summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorGregor Kleen <pngwjpgh@users.noreply.github.com>2017-01-05 20:16:48 +0100
committerGregor Kleen <pngwjpgh@users.noreply.github.com>2017-01-26 12:57:03 +0100
commit06211e700b2b45cf5ea20b9d032322fade3da7d9 (patch)
treebaf81b367eb779257cb05cc82717ccacfb8acb6b /nixos
parentcc1ebd1db46e9d56feaf06b80ba88a632f8c5774 (diff)
downloadnixpkgs-06211e700b2b45cf5ea20b9d032322fade3da7d9.tar
nixpkgs-06211e700b2b45cf5ea20b9d032322fade3da7d9.tar.gz
nixpkgs-06211e700b2b45cf5ea20b9d032322fade3da7d9.tar.bz2
nixpkgs-06211e700b2b45cf5ea20b9d032322fade3da7d9.tar.lz
nixpkgs-06211e700b2b45cf5ea20b9d032322fade3da7d9.tar.xz
nixpkgs-06211e700b2b45cf5ea20b9d032322fade3da7d9.tar.zst
nixpkgs-06211e700b2b45cf5ea20b9d032322fade3da7d9.zip
locate: build in correct dbpath
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/misc/locate.nix6
-rw-r--r--nixos/modules/programs/environment.nix3
2 files changed, 7 insertions, 2 deletions
diff --git a/nixos/modules/misc/locate.nix b/nixos/modules/misc/locate.nix
index e7fc25fc207..a9c84f6db24 100644
--- a/nixos/modules/misc/locate.nix
+++ b/nixos/modules/misc/locate.nix
@@ -113,8 +113,14 @@ in {
         }
       ];
 
+    nixpkgs.config = { locate.dbfile = cfg.output; };
+
     environment.systemPackages = [ cfg.locate ];
 
+    environment.variables = mkIf (!isMLocate)
+      { LOCATE_PATH = cfg.output;
+      };
+
     warnings = optional (isMLocate && cfg.localuser != null) "mlocate does not support searching as user other than root"
             ++ optional (isFindutils && cfg.pruneNames != []) "findutils locate does not support pruning by directory component"
             ++ optional (isFindutils && cfg.pruneBindMounts) "findutils locate does not support skipping bind mounts";
diff --git a/nixos/modules/programs/environment.nix b/nixos/modules/programs/environment.nix
index a35b5cc9513..a1615c920c0 100644
--- a/nixos/modules/programs/environment.nix
+++ b/nixos/modules/programs/environment.nix
@@ -17,8 +17,7 @@ in
   config = {
 
     environment.variables =
-      { LOCATE_PATH = "/var/cache/locatedb";
-        NIXPKGS_CONFIG = "/etc/nix/nixpkgs-config.nix";
+      { NIXPKGS_CONFIG = "/etc/nix/nixpkgs-config.nix";
         PAGER = mkDefault "less -R";
         EDITOR = mkDefault "nano";
       };