locate: build in correct dbpath

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