mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
nixos/lib/make-disk-image.nix: fix systemd-boot-builder clobbering /homeless-shelter
systemd-boot-builder.py calls nix-env --list-generations which creates $HOME/.nix-defexpr/channels/nixos if it doesn't exist. This would cause a folder /homeless-shelter to show up in the final image which in turn breaks nix builds in the target image if sandboxing is turned off (as /homeless-shelter is never allowed to exist).
This commit is contained in:
parent
5304897c5e
commit
b75a29cb6c
2 changed files with 10 additions and 0 deletions
|
@ -609,6 +609,13 @@ let format' = format; in let
|
|||
''}
|
||||
|
||||
# Set up core system link, bootloader (sd-boot, GRUB, uboot, etc.), etc.
|
||||
|
||||
# NOTE: systemd-boot-builder.py calls nix-env --list-generations which
|
||||
# clobbers $HOME/.nix-defexpr/channels/nixos This would cause a folder
|
||||
# /homeless-shelter to show up in the final image which in turn breaks
|
||||
# nix builds in the target image if sandboxing is turned off (through
|
||||
# __noChroot for example).
|
||||
export HOME=$TMPDIR
|
||||
NIXOS_INSTALL_BOOTLOADER=1 nixos-enter --root $mountPoint -- /nix/var/nix/profiles/system/bin/switch-to-configuration boot
|
||||
|
||||
# The above scripts will generate a random machine-id and we don't want to bake a single ID into all our images
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue