-
-
Notifications
You must be signed in to change notification settings - Fork 17.9k
nixos/uki: add bootspec extension #413434
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
base: master
Are you sure you want to change the base?
Conversation
|
At least making the same definition in my own module results in… or if I also wanted to include the UKI in I already modified the systemd-boot script for #413077 but turns out we can't even get the info into the bootspec… :( |
|
Oh, so the bootspec stuff for the regular conf refers to the toplevel with boot.uki.settings.UKI = {
# no config.system.build.toplevel!!
Cmdline = lib.mkOptionDefault "init=${placeholder "out"}/init ${toString config.boot.kernelParams}";
};(without UPD: welp, the resulting placeholder is for |
|
I finally figured out a way to actually do it! We have to do everything inside of the toplevel systemBuilder, that's the only way to avoid recursive dependencies. We have to build the UKI itself there (instead of a boot.uki.settings.UKI.Cmdline = "NOPE"; # get the toplevel $out substitution in systemBuilderCommands
system.systemBuilderCommands = ''
${pkgs.buildPackages.systemdUkify}/lib/systemd/ukify build \
--config=${config.boot.uki.configFile} \
--cmdline="init=$out/init ${toString config.boot.kernelParams}" \
--output="$out/${config.system.boot.loader.ukiFile}"
'';
system.extraSystemBuilderCmds = ''
${pkgs.buildPackages.jq}/bin/jq \
".\"org.nixos.uki\".uki = \"$out/${config.system.boot.loader.ukiFile}\"" \
<$out/boot.json >$out/boot.json.tmp && mv $out/boot.json.tmp $out/boot.json
'';This actually results in working paths: |
Adds a Bootspec extension to store path to UKI files. This allows boot loaders to find UKIs as we wait for NixOS/rfcs#165.
Dependents:
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.