diff options
author | Naïm Favier <n@monade.li> | 2023-01-09 13:20:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-09 13:20:02 +0100 |
commit | b8ee437596d02d8e8992f2a77153726651939f7c (patch) | |
tree | 5c078a8f85dcbc96b444e47790c015661515b6f9 /nixos/tests/installer.nix | |
parent | b199b821c2986ea5ee5e1eb0e2d4baa4ddba1232 (diff) | |
parent | 19cfb3e48c775d3ef5d045265d3ded5cdb16df2c (diff) | |
download | nixpkgs-b8ee437596d02d8e8992f2a77153726651939f7c.tar nixpkgs-b8ee437596d02d8e8992f2a77153726651939f7c.tar.gz nixpkgs-b8ee437596d02d8e8992f2a77153726651939f7c.tar.bz2 nixpkgs-b8ee437596d02d8e8992f2a77153726651939f7c.tar.lz nixpkgs-b8ee437596d02d8e8992f2a77153726651939f7c.tar.xz nixpkgs-b8ee437596d02d8e8992f2a77153726651939f7c.tar.zst nixpkgs-b8ee437596d02d8e8992f2a77153726651939f7c.zip |
Merge pull request #208643 from ncfavier/installer-test-tmp
Diffstat (limited to 'nixos/tests/installer.nix')
-rw-r--r-- | nixos/tests/installer.nix | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/nixos/tests/installer.nix b/nixos/tests/installer.nix index 5f3f61632f0..70f5c9fa009 100644 --- a/nixos/tests/installer.nix +++ b/nixos/tests/installer.nix @@ -49,6 +49,8 @@ let boot.loader.systemd-boot.enable = true; ''} + boot.initrd.secrets."/etc/secret" = /etc/nixos/secret; + users.users.alice = { isNormalUser = true; home = "/home/alice"; @@ -124,6 +126,7 @@ let }", "/mnt/etc/nixos/configuration.nix", ) + machine.copy_from_host("${pkgs.writeText "secret" "secret"}", "/mnt/etc/nixos/secret") with subtest("Perform the installation"): machine.succeed("nixos-install < /dev/null >&2") @@ -131,6 +134,19 @@ let with subtest("Do it again to make sure it's idempotent"): machine.succeed("nixos-install < /dev/null >&2") + with subtest("Check that we can build things in nixos-enter"): + machine.succeed( + """ + nixos-enter -- nix-build --option substitute false -E 'derivation { + name = "t"; + builder = "/bin/sh"; + args = ["-c" "echo nixos-enter build > $out"]; + system = builtins.currentSystem; + preferLocalBuild = true; + }' + """ + ) + with subtest("Shutdown system after installation"): machine.succeed("umount /mnt/boot || true") machine.succeed("umount /mnt") |