locate: build in correct dbpath

+12 -4
+6
nixos/modules/misc/locate.nix
··· 113 113 } 114 114 ]; 115 115 116 + nixpkgs.config = { locate.dbfile = cfg.output; }; 117 + 116 118 environment.systemPackages = [ cfg.locate ]; 119 + 120 + environment.variables = mkIf (!isMLocate) 121 + { LOCATE_PATH = cfg.output; 122 + }; 117 123 118 124 warnings = optional (isMLocate && cfg.localuser != null) "mlocate does not support searching as user other than root" 119 125 ++ optional (isFindutils && cfg.pruneNames != []) "findutils locate does not support pruning by directory component"
+1 -2
nixos/modules/programs/environment.nix
··· 17 17 config = { 18 18 19 19 environment.variables = 20 - { LOCATE_PATH = "/var/cache/locatedb"; 21 - NIXPKGS_CONFIG = "/etc/nix/nixpkgs-config.nix"; 20 + { NIXPKGS_CONFIG = "/etc/nix/nixpkgs-config.nix"; 22 21 PAGER = mkDefault "less -R"; 23 22 EDITOR = mkDefault "nano"; 24 23 };
+5 -2
pkgs/tools/misc/mlocate/default.nix
··· 1 - { stdenv, fetchurl }: 1 + { stdenv, fetchurl, config }: 2 2 3 - stdenv.mkDerivation rec { 3 + let 4 + dbfile = stdenv.lib.attrByPath [ "locate" "dbfile" ] "/var/cache/locatedb" config; 5 + in stdenv.mkDerivation rec { 4 6 name = "mlocate-${version}"; 5 7 version = "0.26"; 6 8 ··· 10 12 }; 11 13 12 14 buildInputs = [ ]; 15 + makeFlags = [ "dbfile=${dbfile}" ]; 13 16 14 17 meta = with stdenv.lib; { 15 18 description = "Merging locate is an utility to index and quickly search for files";