Conversation
|
I noticed that you drop the chroot-realpath package already in the first commit, but then only convert the usage sites to nix-init in the third. Maybe you should delete the package as part of the third commit then? I'll try it out and give a more thorough review later, as I'm on mobile currently. Great work in any case, looking forward to getting this merged! |
That got lost in the wrong commit during rebasing. Thanks for catching it! Fixed now. |
|
I'm guessing the reason most of this couldn't be handled by initrd-systemd directly is because doing so would require a new initrd every generation? If that's the case, what would be the actual requirements for systemd to load? I'm fairly certain it refuses to boot without |
getchoo
left a comment
There was a problem hiding this comment.
This is probably the least important review I've made in Nixpkgs, but here are a couple typos I found while skimming the code
Thanks for all the work in documentation here, though. It made it so much easier to understand as someone not super familiar with our init stuff. The project structure is also great 👍
flokli
left a comment
There was a problem hiding this comment.
Didn't take look at the rust code yet, but did a pass on the text.
|
I booted my laptop with this patch included and everything looks fine. One weird thing is that none of the |
|
(Thanks for the ping and for the great work, hoping to take a look at this soon!) |
That's one of the reasons.
The hard hard requirements are (1) setting up
We've had discussions about this in the community. The issue is that the
Here again, timing is the issue. You want to set these variables very very early but also not too earyl in the initrd. You only want to set them to their stage 2 paths just right before switching root. |
Turns out that I was confused, because with this patch, nixos-init will be used to find the etc overlay image even if I now enabled the option and booted again, and I do see the expected log messages. Everything looks fine, except that my nix store is not getting bind mounted. With the current code, when the nix store is not already a mount point, it does not get remounted. On my system This patch fixes it, by also bind mounting the store if it wasn't a mount point: |
That's still an important test case. You tested that everything works fine even when not enabling nixos-init.
Thank you! Implemented the fix now. |
LordGrimmauld
left a comment
There was a problem hiding this comment.
My complaints were all addressed. I didn't run it on my system, but there is a nixos test and the changes look reasonable. Thank you :)
|
The merge queue seems to be stuck. However, I see nothing wrong. Any objections to bypassing the merge queue rules? |
|
doesn't look stuck to me? |
|
You can press "merge when ready", which adds it to the merge queue. It won't wait on ofborg, it just will never say anything different than "merge when ready" since enabling merge queues. |
Ah Ok, I didn't know that thank you! |
| and newer series. However, embedded chips without LSX (Loongson SIMD eXtension), such as 2K0300 SoC, are not | ||
| supported. `pkgsCross.loongarch64-linux-embedded` can be used to build software and systems for these platforms. | ||
| - The official Nix formatter `nixfmt` is now stable and available as `pkgs.nixfmt`, deprecating the temporary `pkgs.nixfmt-rfc-style` attribute. The classic `nixfmt` will stay available for some more time as `pkgs.nixfmt-classic`. | ||
| - Added `nixos-init`, a Rust-based bashless initialization system for systemd initrd. This allows to build NixOS systems without any interpreter. Enable via `system.nixos-init.enable = true;`. |
There was a problem hiding this comment.
This entry belongs in the NixOS release notes, not the Nixpkgs release notes!

This is the core of #428908
It adds a Rust binary called
nixos-initthat initializes NixOS. It basically replaces prepare-root (which is stage-2-init.sh (which contains the activationScripts)) and some other scripts.Please see the README in the nixos-init package for more documenation and reasoning.
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.