about summary refs log tree commit diff
path: root/nixpkgs/nixos/tests/nix-config.nix
blob: 907e886def351258f106acf5b2ea392a68719b99 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import ./make-test-python.nix ({ pkgs, ... }:
{
  name = "nix-config";
  nodes.machine = { pkgs, ... }: {
    nix.settings = {
      nix-path = [ "nonextra=/etc/value.nix" ];
      extra-nix-path = [ "extra=/etc/value.nix" ];
    };
    environment.etc."value.nix".text = "42";
  };
  testScript = ''
    start_all()
    machine.wait_for_unit("nix-daemon.socket")
    # regression test for the workaround for https://github.com/NixOS/nix/issues/9487
    print(machine.succeed("nix-instantiate --find-file extra"))
    print(machine.succeed("nix-instantiate --find-file nonextra"))
  '';
})