summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorK900 <me@0upti.me>2023-10-02 15:10:22 +0300
committerK900 <me@0upti.me>2023-10-02 15:19:54 +0300
commit4d246838ea510bf9765a760cc97fbb48bc696128 (patch)
treec6f675fb877ca982b61613f6140b224f524ec001
parentMerge pull request #258543 from alyssais/linux-6.6-rc4 (diff)
downloadnixpkgs-origin/dislocate.tar.gz
nixos/locate: rip out dbfile overridesorigin/dislocate
All the locate versions we have support LOCATE_PATH, so just use that instead of adding indirections all over the place AND forcing people to rebuild their locate implementation if they want the path changed.
-rw-r--r--nixos/doc/manual/release-notes/rl-2311.section.md2
-rw-r--r--nixos/modules/misc/locate.nix4
-rw-r--r--pkgs/tools/misc/mlocate/default.nix5
-rw-r--r--pkgs/tools/misc/plocate/default.nix6
4 files changed, 6 insertions, 11 deletions
diff --git a/nixos/doc/manual/release-notes/rl-2311.section.md b/nixos/doc/manual/release-notes/rl-2311.section.md
index f235bca8e7ce..9e8a2a8d6cb6 100644
--- a/nixos/doc/manual/release-notes/rl-2311.section.md
+++ b/nixos/doc/manual/release-notes/rl-2311.section.md
@@ -259,6 +259,8 @@
- Setting `nixpkgs.config` options while providing an external `pkgs` instance will now raise an error instead of silently ignoring the options. NixOS modules no longer set `nixpkgs.config` to accomodate this. This specifically affects `services.locate`, `services.xserver.displayManager.lightdm.greeters.tiny` and `programs.firefox` NixOS modules. No manual intervention should be required in most cases, however, configurations relying on those modules affecting packages outside the system environment should switch to explicit overlays.
+- The `config.locate.dbfile` Nixpkgs option was removed. Users should set the `LOCATE_PATH` environment variable instead.
+
## Other Notable Changes {#sec-release-23.11-notable-changes}
- The Cinnamon module now enables XDG desktop integration by default. If you are experiencing collisions related to xdg-desktop-portal-gtk you can safely remove `xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];` from your NixOS configuration.
diff --git a/nixos/modules/misc/locate.nix b/nixos/modules/misc/locate.nix
index 482d12fe0ca3..b413c46c5365 100644
--- a/nixos/modules/misc/locate.nix
+++ b/nixos/modules/misc/locate.nix
@@ -230,9 +230,9 @@ in
plocate = (mkIf isPLocate (mkMerge [ common plocate ]));
};
- environment.systemPackages = [ (cfg.locate.override { dbfile = cfg.output; }) ];
+ environment.systemPackages = [ cfg.locate ];
- environment.variables = mkIf (!isMorPLocate) { LOCATE_PATH = cfg.output; };
+ environment.variables.LOCATE_PATH = cfg.output;
environment.etc = {
# write /etc/updatedb.conf for manual calls to `updatedb`
diff --git a/pkgs/tools/misc/mlocate/default.nix b/pkgs/tools/misc/mlocate/default.nix
index b57f109eda0a..4cc86df5a897 100644
--- a/pkgs/tools/misc/mlocate/default.nix
+++ b/pkgs/tools/misc/mlocate/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchurl, config, dbfile ? config.locate.dbfile or "/var/cache/locatedb" }:
+{ lib, stdenv, fetchurl }:
stdenv.mkDerivation rec {
pname = "mlocate";
@@ -9,9 +9,6 @@ stdenv.mkDerivation rec {
sha256 = "0gi6y52gkakhhlnzy0p6izc36nqhyfx5830qirhvk3qrzrwxyqrh";
};
- buildInputs = [ ];
- makeFlags = [ "dbfile=${dbfile}" ];
-
meta = with lib; {
description = "Merging locate is an utility to index and quickly search for files";
homepage = "https://pagure.io/mlocate";
diff --git a/pkgs/tools/misc/plocate/default.nix b/pkgs/tools/misc/plocate/default.nix
index a49ff5d18389..8b4cbcbd7ae9 100644
--- a/pkgs/tools/misc/plocate/default.nix
+++ b/pkgs/tools/misc/plocate/default.nix
@@ -1,5 +1,4 @@
-{ config
-, stdenv
+{ stdenv
, lib
, fetchgit
, pkg-config
@@ -8,7 +7,6 @@
, systemd
, liburing
, zstd
-, dbfile ? config.locate.dbfile or "/var/cache/locatedb"
}:
stdenv.mkDerivation rec {
pname = "plocate";
@@ -31,8 +29,6 @@ stdenv.mkDerivation rec {
mesonFlags = [
"-Dsystemunitdir=${placeholder "out"}/etc/systemd/system"
- "-Dsharedstatedir=${builtins.dirOf dbfile}"
- "-Ddbpath=${builtins.baseNameOf dbfile}"
];
meta = with lib; {