Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Systemd stage 1: Unhide docs and round out assertions about unsupported features. #226237

Merged
merged 3 commits into from
Apr 22, 2023

Conversation

ElvishJerricco
Copy link
Contributor

I think 23.05 would be a good time to unhide the systemd initrd options.

@ElvishJerricco ElvishJerricco requested review from a team and dasJ as code owners April 15, 2023 07:38
@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: systemd 8.has: module (update) This PR changes an existing module in `nixos/` labels Apr 15, 2023
@ElvishJerricco
Copy link
Contributor Author

My only concern is that it does add a lot of sort of redundant things to the options list, since it repeats all the systemd options yet again. If anyone knows how to show the top level things like boot.initrd.systemd.services but hide the child options, that would probably be good.

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Apr 15, 2023
@ElvishJerricco ElvishJerricco force-pushed the systemd-stage-1-unhide-docs branch 2 times, most recently from e8692c4 to 8db2585 Compare April 18, 2023 01:24
@ElvishJerricco
Copy link
Contributor Author

ElvishJerricco commented Apr 18, 2023

Ok, I've set the systemd unit options to visible = "shallow";, and now they show up without their child options. That's perfect. I've also added an explanation in boot.initrd.systemd.enable that the unit options are the same as their stage 2 counterparts.

@ElvishJerricco ElvishJerricco force-pushed the systemd-stage-1-unhide-docs branch 2 times, most recently from 0dd1973 to c0928c0 Compare April 18, 2023 01:33
@ElvishJerricco
Copy link
Contributor Author

@arianvp I wasn't expecting the networkd PR to be merged first! :P There's a couple of things to change here now.

  1. The network module should no longer claim to be incompatible.
  2. I should also make the boot.initrd.systemd.network options shallow to some extent.

@flokli flokli marked this pull request as draft April 21, 2023 17:01
@flokli
Copy link
Contributor

flokli commented Apr 21, 2023

@ElvishJerricco can you rebase this on top of current master, and undraft when it's ready for review again?

@ElvishJerricco ElvishJerricco force-pushed the systemd-stage-1-unhide-docs branch from c0928c0 to 67c58d4 Compare April 21, 2023 17:34
@ElvishJerricco ElvishJerricco marked this pull request as ready for review April 21, 2023 17:35
@ElvishJerricco
Copy link
Contributor Author

I'm not exactly happy with the ugly changes to networkd.nix, so please let me know if anyone has a better idea for how to do that.

@ElvishJerricco ElvishJerricco force-pushed the systemd-stage-1-unhide-docs branch from 67c58d4 to 1598338 Compare April 22, 2023 01:53
@ElvishJerricco
Copy link
Contributor Author

Ok I think that's a little better for networkd.

/cc @arianvp

@flokli flokli merged commit 7ad24e9 into NixOS:master Apr 22, 2023
@amaxine
Copy link
Contributor

amaxine commented Apr 22, 2023

I've been happily running systemd in stage 1 for a few weeks now, but with this PR I can't rebuild my system with it enabled? Is that intentional, and I shouldn't have been running systemd stage 1 yet when using zfs?

error:
       Failed assertions:
       - systemd stage 1 does not support 'boot.initrd.postDeviceCommands'. Please
       convert it to analogous systemd units in 'boot.initrd.systemd'.

         Definitions:
         - /home/systems/nixpkgs/nixos/modules/tasks/filesystems/zfs.nix

       - systemd stage 1 does not support 'boot.initrd.extraUtilsCommands'. Please
       convert it to analogous systemd units in 'boot.initrd.systemd'.

         Definitions:
         - /home/systems/nixpkgs/nixos/modules/tasks/filesystems/zfs.nix

       - systemd stage 1 does not support 'boot.initrd.extraUtilsCommandsTest'. Please
       convert it to analogous systemd units in 'boot.initrd.systemd'.

         Definitions:
         - /home/systems/nixpkgs/nixos/modules/tasks/filesystems/zfs.nix
(use '--show-trace' to show detailed location information)

@flokli
Copy link
Contributor

flokli commented Apr 22, 2023

This PR added some assertions, because systemd in initrd actually ignores some of these keys.

What are these keys set to in your case?

@lilyinstarlight
Copy link
Member

@flokli, those are being set automatically by the ZFS module so I think that module needs to be updated to conditionalize some of the boot.initrd. settings it does based on boot.initrd.systemd.enable

@amaxine
Copy link
Contributor

amaxine commented Apr 22, 2023

Sorry, should have added the context there. Exactly what @lilyinstarlight said, this is just a side effect of having the zfs module enabled, nothing special on my side.

@mweinelt mweinelt added this to the 23.05 milestone Apr 22, 2023
@ElvishJerricco
Copy link
Contributor Author

Ok I thought I had checked the boot.initrd.*Commands things better than I did. We should probably revert that specific change and go over it with a more fine tooth comb, preferably but not necessarily before 23.05.

lilyinstarlight added a commit to lilyinstarlight/nixpkgs that referenced this pull request Jul 3, 2023
These options were missed in NixOS#226237, but they all were
specifically added for systemd stage-1.
@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/using-immutable-users-with-impermanence-on-luks/43459/1

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 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants