nixos/systemd-boot: Add extraEntries and extraFiles options#150408
nixos/systemd-boot: Add extraEntries and extraFiles options#150408pennae merged 5 commits intoNixOS:masterfrom
extraEntries and extraFiles options#150408Conversation
85dd512 to
f0c1000
Compare
ee82412 to
f68cac0
Compare
pennae
left a comment
There was a problem hiding this comment.
looks good now, just one thing we missed on the first go and one suggestion :)
f68cac0 to
a10c456
Compare
a10c456 to
2f0cfde
Compare
pennae
left a comment
There was a problem hiding this comment.
tested locally, looks good!
`mktemp` tries to use the `TMPDIR` from `nixos-install` outside of the `chroot` instead of `/tmp` inside the `chroot` and fails. For some reason the `TMPDIR` is being passed through the `chroot` call. I haven't tested if other environment variables are being passed through that shouldn't be.
|
@pennae you might be interested in taking a look at the newest commit I just made. Found this bug when doing a fresh install of NixOS using this branch 😄 |
|
ping cc @pennae |
| netbootxyz = if cfg.netbootxyz.enable then pkgs.netbootxyz-efi else ""; | ||
|
|
||
| copyExtraFiles = pkgs.writeShellScript "copy-extra-files" '' | ||
| empty_file=$(mktemp) |
There was a problem hiding this comment.
nitpick if you're up to it: we've since learned about the pkgs.emptyFile trivial builder. might be better to use that, and solve the TMPDIR problem with the installer?
apart from that, LGTM
There was a problem hiding this comment.
nixpkgs/nixos/modules/installer/tools/nixos-enter.sh
Lines 103 to 104 in 1783cfd
I think the TMPDIR needs to be fixed irrespective of whether this PR uses it or not, as the nixos-enter script creates /tmp but then won't even use it if TMPDIR is set.
My current preference is to keep mktemp to dogfood the nixos-enter command :)
There was a problem hiding this comment.
how did you find that? just tested an installer run (on 21.11 though, not unstable) and found that TMPDIR wasn't set.
There was a problem hiding this comment.
I ran the installer off this PR
TMPDIR is set in nixos-install
nixpkgs/nixos/modules/installer/tools/nixos-install.sh
Lines 137 to 142 in 1783cfd
Which then calls nixos-enter:
I'm guessing this bug wasn't found because nothing else was using TMPDIR
There was a problem hiding this comment.
interactions between different sides of the same chroot sure can be confusing. 👍
Motivation for this change
These options allow people to add their own EFI files and corresponding entries to
systemd-boot.I have also added
boot.loader.systemd-boot.netbootxyzoptions to allow people to easily addnetboot.xyzto their boot menu.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