Skip to content

nixos/systemd: convert extraConfig to rfc 42#426692

Merged
emilazy merged 21 commits intoNixOS:masterfrom
LordGrimmauld:systemd-system-conf-rfc42
Jul 28, 2025
Merged

nixos/systemd: convert extraConfig to rfc 42#426692
emilazy merged 21 commits intoNixOS:masterfrom
LordGrimmauld:systemd-system-conf-rfc42

Conversation

@LordGrimmauld
Copy link
Copy Markdown
Contributor

@LordGrimmauld LordGrimmauld commented Jul 19, 2025

Converted systemd.extraConfigand boot.initrd.systemd.extraConfig to rfc-42-style systemd.settings.
Moved explicit definitions for system.conf to set settings instead.

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 others READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 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 Jul 19, 2025
@LordGrimmauld LordGrimmauld force-pushed the systemd-system-conf-rfc42 branch from 080e11f to 0716528 Compare July 20, 2025 08:20
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. labels Jul 20, 2025
@LordGrimmauld LordGrimmauld marked this pull request as ready for review July 20, 2025 10:14
@nix-owners nix-owners bot requested review from aanderse and flokli July 20, 2025 10:16
@LordGrimmauld LordGrimmauld changed the title WIP: nixos/systemd: convert extraConfig to rfc 42 nixos/systemd: convert extraConfig to rfc 42 Jul 20, 2025
@nix-owners nix-owners bot requested a review from arianvp July 20, 2025 10:16
@LordGrimmauld LordGrimmauld force-pushed the systemd-system-conf-rfc42 branch 3 times, most recently from f766037 to ee9a541 Compare July 20, 2025 15:26
Copy link
Copy Markdown
Contributor

@ElvishJerricco ElvishJerricco left a comment

Choose a reason for hiding this comment

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

Code LGTM. We might want a release note, though I think you could argue the mkRemovedOptionModule and mkRenamedOptionModule take care of migration instructions sufficiently on their own.

@emilazy had mentioned on matrix that systemd.settings could potentially be an attrset of sections, but given that there's only one valid section I think that would just needlessly obscure the option documentation.

@nixpkgs-ci nixpkgs-ci bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jul 21, 2025
@LordGrimmauld
Copy link
Copy Markdown
Contributor Author

Adding a release notes entry is still a good idea, i just feared all the merge conflicts and wanted to rebase once in the end if necessary. With your approval, this went faster than expected, so i added them now.

@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 Jul 21, 2025
Copy link
Copy Markdown
Member

@emilazy emilazy left a comment

Choose a reason for hiding this comment

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

Thanks, this seems good to me; a few more nits and I’d be happy to see this landed.

settings.Manager feels weird to me but I can’t come up with any concrete problem it’ll cause to change it down the line. If/when we migrate systemd.network.config we’ll need a thing to produce the section structure, so we can adjust this then.

Comment on lines 673 to 683
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’d still like to see this RFC 42‐ized, but I agree that it can wait for another PR.)

@nixpkgs-ci nixpkgs-ci bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jul 24, 2025
@LordGrimmauld LordGrimmauld force-pushed the systemd-system-conf-rfc42 branch from eb25600 to 8d2b172 Compare July 28, 2025 09:25
The limit was introduced in 2016 in 840f323,
and broken iin 2019 in bafc256. Since then,
it is the exact same as systemd itself sets as default.
This option is now being ignored by systemd,
so we do not need to explicitly define it.
This option is made uncondiotional in systemd 258 [1].
Earlier, it defaulted to true on kernels newer than 4.15,
which applies to all supported nixos kernels.
This means removing the option does not change behavior.

[1] systemd/systemd@29da53d
cgroup accounting is enabled by default, and the option is scheduled for removal.
@LordGrimmauld LordGrimmauld force-pushed the systemd-system-conf-rfc42 branch from 8d2b172 to 6cd6573 Compare July 28, 2025 09:27
@nixpkgs-ci nixpkgs-ci bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jul 28, 2025
Copy link
Copy Markdown
Member

@emilazy emilazy left a comment

Choose a reason for hiding this comment

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

Looks great to me, thank you!

@emilazy emilazy merged commit 1adf0f5 into NixOS:master Jul 28, 2025
25 of 27 checks passed
jtojnar added a commit to jtojnar/nixfiles that referenced this pull request Aug 3, 2025
Flake lock file updates:

• Updated input 'home-manager':
    'github:nix-community/home-manager/0630790b31d4547d79ff247bc3ba1adda3a017d9' (2025-07-30)
  → 'github:nix-community/home-manager/0de18bd5c6681280d7ae017fa34ffd91bdcf0557' (2025-08-03)

• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/dc9637876d0dcc8c9e5e22986b857632effeb727' (2025-07-28)
  → 'github:nixos/nixpkgs/94def634a20494ee057c76998843c015909d6311' (2025-07-31)

  - `systemd.extraConfig` replaced with RFC42-style option NixOS/nixpkgs#426692

• Updated input 'vpsadminos':
    'github:vpsfreecz/vpsadminos/f0580af94a38240ed88da3de980ac3332612b255' (2025-07-30)
  → 'github:vpsfreecz/vpsadminos/5bdd1250a7a74694e29908bcd335992ee7bcc6d6' (2025-08-02)
@nixos-discourse
Copy link
Copy Markdown

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/breaking-changes-announcement-for-unstable/17574/89

@ncfavier
Copy link
Copy Markdown
Member

Are you planning to convert systemd.user.extraConfig as well?

@LordGrimmauld
Copy link
Copy Markdown
Contributor Author

ideally both networkd config and user.extraConfig get converted, but there is currently a couple other things i am working on. I'll pick those up once i have time.

@LordGrimmauld
Copy link
Copy Markdown
Contributor Author

if you want to do that though, feel free to open a PR. I won't block any motivated entity from contributing this before i do.

donovanglover added a commit to donovanglover/nix-config that referenced this pull request Sep 6, 2025
Updates nixos-unstable to 2025-08-03.

systemd.extraConfig was removed in NixOS/nixpkgs#426692
fabianhauser pushed a commit to qo-is/infrastructure that referenced this pull request Dec 1, 2025
fabianhauser pushed a commit to qo-is/infrastructure that referenced this pull request Jan 8, 2026
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: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants