Merge pull request #258434 from SuperSandro2000/locate-dbfile
nixos/locate: #258575 followup
This commit is contained in:
commit
9d2e9d8ddf
3 changed files with 13 additions and 7 deletions
|
@ -6,7 +6,7 @@ let
|
|||
cfg = config.services.locate;
|
||||
isMLocate = hasPrefix "mlocate" cfg.locate.name;
|
||||
isPLocate = hasPrefix "plocate" cfg.locate.name;
|
||||
isMorPLocate = (isMLocate || isPLocate);
|
||||
isMorPLocate = isMLocate || isPLocate;
|
||||
isFindutils = hasPrefix "findutils" cfg.locate.name;
|
||||
in
|
||||
{
|
||||
|
@ -216,18 +216,18 @@ in
|
|||
setgid = true;
|
||||
setuid = false;
|
||||
};
|
||||
mlocate = (mkIf isMLocate {
|
||||
mlocate = mkIf isMLocate {
|
||||
group = "mlocate";
|
||||
source = "${cfg.locate}/bin/locate";
|
||||
});
|
||||
plocate = (mkIf isPLocate {
|
||||
};
|
||||
plocate = mkIf isPLocate {
|
||||
group = "plocate";
|
||||
source = "${cfg.locate}/bin/plocate";
|
||||
});
|
||||
};
|
||||
in
|
||||
mkIf isMorPLocate {
|
||||
locate = mkMerge [ common mlocate plocate ];
|
||||
plocate = (mkIf isPLocate (mkMerge [ common plocate ]));
|
||||
plocate = mkIf isPLocate (mkMerge [ common plocate ]);
|
||||
};
|
||||
|
||||
environment.systemPackages = [ cfg.locate ];
|
||||
|
|
|
@ -5,10 +5,14 @@ stdenv.mkDerivation rec {
|
|||
version = "0.26";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://releases.pagure.org/mlocate/${pname}-${version}.tar.xz";
|
||||
url = "https://releases.pagure.org/mlocate/mlocate-${version}.tar.xz";
|
||||
sha256 = "0gi6y52gkakhhlnzy0p6izc36nqhyfx5830qirhvk3qrzrwxyqrh";
|
||||
};
|
||||
|
||||
makeFlags = [
|
||||
"dbfile=/var/cache/locatedb"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Merging locate is an utility to index and quickly search for files";
|
||||
homepage = "https://pagure.io/mlocate";
|
||||
|
|
|
@ -29,6 +29,8 @@ stdenv.mkDerivation rec {
|
|||
|
||||
mesonFlags = [
|
||||
"-Dsystemunitdir=${placeholder "out"}/etc/systemd/system"
|
||||
"-Dsharedstatedir=/var/cache"
|
||||
"-Ddbpath=locatedb"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
|
|
Loading…
Reference in a new issue