From 514ca33745e0f366c8e62e95dd5e0b2ca91e6df8 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Wed, 3 Sep 2025 13:11:50 +0200 Subject: [PATCH 1/4] procps: use `finalAttrs` pattern --- pkgs/os-specific/linux/procps-ng/default.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/os-specific/linux/procps-ng/default.nix b/pkgs/os-specific/linux/procps-ng/default.nix index a8fbc328b178..124799035976 100644 --- a/pkgs/os-specific/linux/procps-ng/default.nix +++ b/pkgs/os-specific/linux/procps-ng/default.nix @@ -21,13 +21,13 @@ procps, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "procps"; version = "4.0.4"; # The project's releases are on SF, but git repo on gitlab. src = fetchurl { - url = "mirror://sourceforge/procps-ng/procps-ng-${version}.tar.xz"; + url = "mirror://sourceforge/procps-ng/procps-ng-${finalAttrs.version}.tar.xz"; hash = "sha256-IocNb+skeK22F85PCaeHrdry0mDFqKp7F9iJqWLF5C4="; }; @@ -64,12 +64,12 @@ stdenv.mkDerivation rec { execer cannot bin/{ps,top,free} ''; - meta = with lib; { + meta = { homepage = "https://gitlab.com/procps-ng/procps"; description = "Utilities that give information about processes using the /proc filesystem"; priority = 11; # less than coreutils, which also provides "kill" and "uptime" - license = licenses.gpl2Plus; - platforms = platforms.unix; + license = lib.licenses.gpl2Plus; + platforms = lib.platforms.unix; maintainers = [ ]; }; -} +}) From de62b313252c42baec203efbbec0682b82fcbf9a Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Wed, 3 Sep 2025 13:12:41 +0200 Subject: [PATCH 2/4] procps: use `lib.optionals` --- pkgs/os-specific/linux/procps-ng/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/procps-ng/default.nix b/pkgs/os-specific/linux/procps-ng/default.nix index 124799035976..f162cf0cfd00 100644 --- a/pkgs/os-specific/linux/procps-ng/default.nix +++ b/pkgs/os-specific/linux/procps-ng/default.nix @@ -31,7 +31,7 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-IocNb+skeK22F85PCaeHrdry0mDFqKp7F9iJqWLF5C4="; }; - buildInputs = [ ncurses ] ++ lib.optional withSystemd systemd; + buildInputs = [ ncurses ] ++ lib.optionals withSystemd [ systemd ]; nativeBuildInputs = [ pkg-config autoreconfHook @@ -46,8 +46,8 @@ stdenv.mkDerivation (finalAttrs: { "--disable-modern-top" "--enable-watch8bit" ] - ++ lib.optional withSystemd "--with-systemd" - ++ lib.optional stdenv.hostPlatform.isMusl "--disable-w" + ++ lib.optionals withSystemd [ "--with-systemd" ] + ++ lib.optionals stdenv.hostPlatform.isMusl [ "--disable-w" ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "ac_cv_func_malloc_0_nonnull=yes" "ac_cv_func_realloc_0_nonnull=yes" From ec8cebbdc94fddab2c7d0a7a5368d14f87aec77f Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Wed, 3 Sep 2025 13:13:35 +0200 Subject: [PATCH 3/4] procps: add missing phase hooks --- pkgs/os-specific/linux/procps-ng/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/os-specific/linux/procps-ng/default.nix b/pkgs/os-specific/linux/procps-ng/default.nix index f162cf0cfd00..03ce13abe1bc 100644 --- a/pkgs/os-specific/linux/procps-ng/default.nix +++ b/pkgs/os-specific/linux/procps-ng/default.nix @@ -54,8 +54,12 @@ stdenv.mkDerivation (finalAttrs: { ]; installPhase = lib.optionalString watchOnly '' + runHooks preInstall + install -m 0755 -D src/watch $out/bin/watch install -m 0644 -D man/watch.1 $out/share/man/man1/watch.1 + + runHooks postInstall ''; # no obvious exec in documented arguments; haven't trawled source From c6e588c6caf9682f0b8eddedc35b1887210a72d5 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Wed, 3 Sep 2025 13:14:01 +0200 Subject: [PATCH 4/4] procps: use `systemdLibs` --- pkgs/os-specific/linux/procps-ng/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/procps-ng/default.nix b/pkgs/os-specific/linux/procps-ng/default.nix index 03ce13abe1bc..027806f45225 100644 --- a/pkgs/os-specific/linux/procps-ng/default.nix +++ b/pkgs/os-specific/linux/procps-ng/default.nix @@ -8,8 +8,8 @@ # `ps` with systemd support is able to properly report different # attributes like unit name, so we want to have it on linux. - withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd, - systemd, + withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemdLibs, + systemdLibs, # procps is mostly Linux-only. Most commands require a running Linux # system (or very similar like that found in Cygwin). The one @@ -31,7 +31,7 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-IocNb+skeK22F85PCaeHrdry0mDFqKp7F9iJqWLF5C4="; }; - buildInputs = [ ncurses ] ++ lib.optionals withSystemd [ systemd ]; + buildInputs = [ ncurses ] ++ lib.optionals withSystemd [ systemdLibs ]; nativeBuildInputs = [ pkg-config autoreconfHook