nixos: systemd: split module up into multiple files#164016
nixos: systemd: split module up into multiple files#164016flokli merged 17 commits intoNixOS:masterfrom
Conversation
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
ede620c to
2991ce5
Compare
d07fd68 to
7339fbc
Compare
Currently it is only possible to add upstream _system_ units. The option systemd.additionalUpstreamSystemUnits can be used for this. However, this was not yet possible for systemd.user. In a similar fashion this was added to systemd-user.nix. This is intended to have other modules add upstream units.
7339fbc to
753b911
Compare
|
Unfortunately I couldn't make the build-result unchanged, because the order of I ran for each of the commits to make sure they succeed: |
|
cc @NixOS/systemd |
|
I would really like to see this merge. It's been helpful in my systemd-initramfs effort |
|
@GrahamcOfBorg test systemd |
|
Could we squash the Apart from that LGTM |
dasJ
left a comment
There was a problem hiding this comment.
Changes look great, apart from my (somewhat opinionated) minor style nits ;)
I'd be happy if this went through without my concerns being adressed, so I'm only commenting here and not requesting changes.
…Units Co-authored-by: Janne Heß <janne@hess.ooo>
@ElvishJerricco Review approval would help 😄 👍 |
dasJ
left a comment
There was a problem hiding this comment.
LGTM. If nobody brings up arguments why I shouldn't, I'd merge this tomorrow or so
mweinelt
left a comment
There was a problem hiding this comment.
Looks sane enough. Tested on my desktop and I didn't notice any regression.
Co-authored-by: Martin Weinelt <mweinelt@users.noreply.github.com>
|
🥳 thank you all! |
Description of changes
Currently the systemd module is quite large. It contains multiple components that could be split off into separate files.
The idea behind this refactor is to not only make the modules more readable, but it is also a step towards more reusable systemd configuration building.
This PR does introduce a new option called
systemd.additionalUpstreamUserUnits. It was introduced to have systemd-tmpfiles specify its own user units, instead of systemd-user doing that for systemd-tmpfiles. I think the way these upstream units still needs a bit of work, but I intend to do that in a separate PR.A next step is to generalize unit directory building between systemd system and systemd user. The main intention is to also reuse this for systemd in initrd (#120015). It avoids creating yet another system of unit building.
I did not ran all tests, but I did ran the systemd tests as well as applied this configuration to my own system.
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes