Skip to content

systemd: drop most patches - #488508

Merged
RaitoBezarius merged 14 commits into
NixOS:stagingfrom
nikstur:systemd-patches
Apr 10, 2026
Merged

RaitoBezarius merged 14 commits into
NixOS:stagingfrom
nikstur:systemd-patches

Conversation

@nikstur

@nikstur nikstur commented Feb 8, 2026 •

Copy link
Copy Markdown
Contributor

This adds a patch policy to systemd that @arianvp and I came up with.

Based on this policy, I removed most patches. See the commit messages for more details.

This will bring us much closer to a "vanilla" systemd build making maintenance easier and enables faster systemd updates. It also will make it easier for NixOS users to hack on systemd itself.

This is quite important right now because systemd has sped up their release cadence. They will release versions much quicker and thus we also need to become much faster in our packaging.

See #80038 for some earlier discussions of the patches. This PR brings us closer to the goal formulated there.

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

@nikstur
nikstur requested review from Ma27, arianvp and flokli February 8, 2026 22:21
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 6.topic: systemd Software suite that provides an array of system components for Linux operating systems. labels Feb 8, 2026

@ElvishJerricco ElvishJerricco left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any functionality being removed needs to be in release notes.

@nikstur

nikstur commented Feb 9, 2026

Copy link
Copy Markdown
Contributor Author

@ElvishJerricco

Any functionality being removed needs to be in release notes.

Nothing in here IMO qualifies as "functionality being removed" anymore.

@nixpkgs-ci nixpkgs-ci Bot added 8.has: changelog This PR adds or changes release notes 8.has: documentation This PR adds or changes documentation labels Feb 10, 2026

@SuperSandro2000 SuperSandro2000 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest we remove all the patches which can be clearly removed now and leave the 2 patches which people think are worthwhile for now.

@emilazy emilazy mentioned this pull request Feb 14, 2026
5 of 13 tasks
nikstur added 4 commits April 10, 2026 00:38
…s.patch

This is possibile because of the preparations from 4aae99b
This was fixed when we switched to patching dlopen.
…sy.patch

This is entirely a "usability" patch which as per the new patch policy
is not allowed.
@nikstur

nikstur commented Apr 9, 2026

Copy link
Copy Markdown
Contributor Author

My suggestion to get this merged is:

  1. Merge as is with the patch numbers as they currently are to make reviewing and rebasing easy
  2. Follow-up PR after this is merged to reflow the patches so that they have the correct numbering.

@nixpkgs-ci
nixpkgs-ci Bot requested review from a team, balsoft, infinisil and pyrox0 April 9, 2026 22:52
@nixpkgs-ci nixpkgs-ci Bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Apr 9, 2026
@RaitoBezarius
RaitoBezarius added this pull request to the merge queue Apr 10, 2026
@nixpkgs-ci nixpkgs-ci Bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Apr 10, 2026
Merged via the queue into NixOS:staging with commit d3aa684 Apr 10, 2026
27 of 29 checks passed
@balsoft balsoft moved this from Needs Review to Reviewed in Nixpkgs security review Apr 11, 2026
@nikstur nikstur mentioned this pull request Apr 11, 2026
13 tasks

-# Ignore encrypted devices with no identified superblock on it, since
-# we are probably still calling mke2fs or mkswap on it.
-SUBSYSTEM=="block", ENV{DM_UUID}=="CRYPT-*", ENV{ID_PART_TABLE_TYPE}=="", ENV{ID_FS_USAGE}=="", ENV{SYSTEMD_READY}="0"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropping this patch actually breaks booting with systemd while using a password-encrypted luks volume as a key-file to another luks volume (which is where the root file system is).

Fixing this breakage by bringing the patch back in #525118

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran into this as well. Took me 4h to end up here, and glad to find I'm not alone :)

Adding the fix below to hardware-configuration.nix solved it for me (note the 99-zz prefix to make sure the rule comes last)

  boot.initrd.services.udev.packages = [
    (pkgs.writeTextDir "etc/udev/rules.d/99-zz-cryptkey-ready.rules" ''
      SUBSYSTEM=="block", ENV{DM_UUID}=="CRYPT-*", ENV{DM_NAME}=="cryptkey", ENV{SYSTEMD_READY}="1"
    '')
  ];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another one here. Took some head scratching for me and I ended up with similar solution mentioned in previous comment. Lovely

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lf- pushed a commit to lix-project/lix that referenced this pull request May 31, 2026
Noticed on my quest to make Lix buildable against multiple nixpkgs' to
provide pre-warmed caches for the flake on AFNix's Hydra.

`pkgs.systemd` has a new patch policy[1] that only allows patches for
hotfixes and fundamental incompatibilities. As such, the patch that
allows nspawn workloads to start without a `/usr/bin` was removed with the
recommendation to create that stub yourself.

[1] NixOS/nixpkgs#488508

Change-Id: Iaa35ae3b8971867f12daeac5f94958c20a7d9233
pull Bot pushed a commit to phanirithvij/nixpkgs that referenced this pull request Jul 10, 2026
Since NixOS#488508 was merged, systemd nspawn now expects /usr to exist
in the rootfs before it will start a container.

Create the /usr directory in the relevant containers throughout this
test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: systemd Software suite that provides an array of system components for Linux operating systems. 8.has: changelog This PR adds or changes release notes 8.has: documentation This PR adds or changes documentation 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.