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.
This commit is contained in:
Maximilian Bosch
2025-09-13 12:32:16 +02:00
parent 08e1d08602
commit 7ca8298b9a
+5 -6
View File
@@ -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")