about summary refs log tree commit diff
path: root/nixpkgs/nixos/tests/nix-config.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/nixos/tests/nix-config.nix')
-rw-r--r--nixpkgs/nixos/tests/nix-config.nix18
1 files changed, 18 insertions, 0 deletions
diff --git a/nixpkgs/nixos/tests/nix-config.nix b/nixpkgs/nixos/tests/nix-config.nix
new file mode 100644
index 000000000000..907e886def35
--- /dev/null
+++ b/nixpkgs/nixos/tests/nix-config.nix
@@ -0,0 +1,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"))
+  '';
+})