diff --git a/pkgs/by-name/ni/nixos-install/nixos-install.sh b/pkgs/by-name/ni/nixos-install/nixos-install.sh index b428406f95a2f..2a592223a921e 100755 --- a/pkgs/by-name/ni/nixos-install/nixos-install.sh +++ b/pkgs/by-name/ni/nixos-install/nixos-install.sh @@ -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`. diff --git a/pkgs/by-name/ni/nixos-install/package.nix b/pkgs/by-name/ni/nixos-install/package.nix index fbe75619674ed..7ffc2984ef038 100644 --- a/pkgs/by-name/ni/nixos-install/package.nix +++ b/pkgs/by-name/ni/nixos-install/package.nix @@ -7,6 +7,7 @@ jq, nixos-enter, util-linuxMinimal, + nixosTests, }: substituteAll { name = "nixos-install"; @@ -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";