From 3edde6562e19698da69a499881e0a2e4f5a497a2 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sat, 7 Nov 2020 13:04:50 +0100 Subject: [PATCH] make-test-python: disallow aliases When importing Nixpkgs within Nixpkgs, we should not consider aliases to ensure we don't rely on them internally. There are probably more places that need to be converted. --- nixos/lib/testing-python.nix | 8 +++++++- nixos/tests/make-test-python.nix | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/nixos/lib/testing-python.nix b/nixos/lib/testing-python.nix index c9d4f0f0861..99d0a9a0bfa 100644 --- a/nixos/lib/testing-python.nix +++ b/nixos/lib/testing-python.nix @@ -130,7 +130,13 @@ rec { { virtualisation.qemu.package = qemu_pkg; } - ); + ) ++ [( + { + # Ensure we do not use aliases. Ideally this is only set + # when the test framework is used by Nixpkgs NixOS tests. + nixpkgs.config.allowAliases = false; + } + )]; }; # FIXME: get this pkg from the module system diff --git a/nixos/tests/make-test-python.nix b/nixos/tests/make-test-python.nix index 89897fe7e61..7a96f538d8d 100644 --- a/nixos/tests/make-test-python.nix +++ b/nixos/tests/make-test-python.nix @@ -1,6 +1,6 @@ f: { system ? builtins.currentSystem, - pkgs ? import ../.. { inherit system; config = {}; }, + pkgs ? import ../.. { inherit system; }, ... } @ args: