Merge pull request #258434 from SuperSandro2000/locate-dbfile

nixos/locate: #258575 followup
This commit is contained in:
K900 2023-10-03 08:58:20 +03:00 committed by GitHub
commit 9d2e9d8ddf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 7 deletions

View file

@ -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 ];

View file

@ -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";

View file

@ -29,6 +29,8 @@ stdenv.mkDerivation rec {
mesonFlags = [
"-Dsystemunitdir=${placeholder "out"}/etc/systemd/system"
"-Dsharedstatedir=/var/cache"
"-Ddbpath=locatedb"
];
meta = with lib; {