From 7ca8298b9ade6909696d65aae4fbdc45717a7af7 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sat, 13 Sep 2025 12:27:03 +0200 Subject: [PATCH] systemd: use finalAttrs.version I recently deployed systemd 257.9 to a bunch of machines as mitigation for #440073. This caused some confusion in the aftermath since we had 257.9 deployed (via an override for `systemd.package` to not rebuild the world), but `systemctl --version` still reported 257.8. This patch fixes that problem by using the final version everywhere instead of the version from the let-binding. I decided to remove the let-binding entirely to avoid re-introducing the wrong usage again. --- pkgs/os-specific/linux/systemd/default.nix | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 32a963e12cd05..6b87c7b481beb 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -195,8 +195,6 @@ assert withBootloader -> withEfi; let wantCurl = withRemote || withImportd; - version = "257.8"; - # Use the command below to update `releaseTimestamp` on every (major) version # change. More details in the commentary at mesonFlags. # command: @@ -207,14 +205,15 @@ let kbd' = if withPam then kbd else kbd.override { withVlock = false; }; in stdenv.mkDerivation (finalAttrs: { - inherit pname version; + inherit pname; + version = "257.8"; # We use systemd/systemd-stable for src, and ship NixOS-specific patches inside nixpkgs directly # This has proven to be less error-prone than the previous systemd fork. src = fetchFromGitHub { owner = "systemd"; repo = "systemd"; - rev = "v${version}"; + rev = "v${finalAttrs.version}"; hash = "sha256-XQ+IyRar74qQij96CKClHXW0kkPnGeKUgA8ULiWh5YY="; }; @@ -456,7 +455,7 @@ stdenv.mkDerivation (finalAttrs: { # https://github.com/systemd/systemd/blob/60e930fc3e6eb8a36fbc184773119eb8d2f30364/NEWS#L258-L266 (lib.mesonOption "time-epoch" releaseTimestamp) - (lib.mesonOption "version-tag" version) + (lib.mesonOption "version-tag" finalAttrs.version) (lib.mesonOption "mode" "release") (lib.mesonOption "tty-gid" "3") # tty in NixOS has gid 3 (lib.mesonOption "pamconfdir" "${placeholder "out"}/etc/pam.d") @@ -491,7 +490,7 @@ stdenv.mkDerivation (finalAttrs: { (lib.mesonOption "sbat-distro-summary" "NixOS") (lib.mesonOption "sbat-distro-url" "https://nixos.org/") (lib.mesonOption "sbat-distro-pkgname" pname) - (lib.mesonOption "sbat-distro-version" version) + (lib.mesonOption "sbat-distro-version" finalAttrs.version) # Users (lib.mesonOption "system-uid-max" "999")