Skip to content

Commit

Permalink
nixos-install: clear executable cache after entering chroot (NixOS#35…
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 authored Dec 15, 2024
2 parents f910ead + b0dfd60 commit c142740
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkgs/by-name/ni/nixos-install/nixos-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@ if [[ -z $noBootLoader ]]; then
export mountPoint
NIXOS_INSTALL_BOOTLOADER=1 nixos-enter --root "$mountPoint" -c "$(cat <<'EOF'
set -e
# Clear the cache for executable locations. They were invalidated by the chroot.
hash -r
# Create a bind mount for each of the mount points inside the target file
# system. This preserves the validity of their absolute paths after changing
# the root with `nixos-enter`.
Expand Down
3 changes: 3 additions & 0 deletions pkgs/by-name/ni/nixos-install/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
jq,
nixos-enter,
util-linuxMinimal,
nixosTests,
}:
substituteAll {
name = "nixos-install";
Expand All @@ -29,6 +30,8 @@ substituteAll {
installManPage ${./nixos-install.8}
'';

passthru.tests.installer-simpleUefiSystemdBoot = nixosTests.installer.simpleUefiSystemdBoot;

meta = {
description = "Install bootloader and NixOS";
homepage = "https://github.com/NixOS/nixpkgs/tree/master/pkgs/by-name/ni/nixos-install";
Expand Down

0 comments on commit c142740

Please sign in to comment.