summaryrefslogtreecommitdiffstats
path: root/nixos/tests/disable-installer-tools.nix
blob: 902b9f0ff5054a5cc7ab039675c3315830c6c1ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{
  pkgs,
  latestKernel ? false,
  ...
}:

{
  name = "disable-installer-tools";

  nodes.machine =
    { pkgs, lib, ... }:
    {
      system.disableInstallerTools = true;
      environment.defaultPackages = [ ];
    };

  testScript = ''
    machine.wait_for_unit("multi-user.target")
    machine.wait_until_succeeds("pgrep -f 'agetty.*tty1'")

    with subtest("nixos installer tools should not be included"):
        machine.fail("which nixos-rebuild")
        machine.fail("which nixos-install")
        machine.fail("which nixos-generate-config")
        machine.fail("which nixos-enter")
        machine.fail("which nixos-version")
        machine.fail("which nixos-build-vms")

    with subtest("perl should not be included"):
        machine.fail("which perl")
  '';
}