From dac162306761ce5ea0aaaa59a3792dec928f990c Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Fri, 5 Sep 2025 16:34:16 +0200 Subject: [PATCH] tests: move pkgsForTests definition to tests/default.nix --- tests/default.nix | 11 ++++++++++- tests/main.nix | 8 +------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/tests/default.nix b/tests/default.nix index 3f40862a..bbc672ca 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -7,7 +7,15 @@ system ? pkgs.stdenv.hostPlatform.system, }: let - autoArgs = pkgs // { + + # Use a single common instance of nixpkgs, with allowUnfree + # Having a single shared instance should speed up tests a little + pkgsForTest = import self.inputs.nixpkgs { + inherit system; + config.allowUnfree = true; + }; + + autoArgs = pkgsForTest // { inherit helpers self @@ -25,6 +33,7 @@ let ; # Recursive: inherit callTest callTests; + inherit pkgsForTest; }; callTest = lib.callPackageWith autoArgs; diff --git a/tests/main.nix b/tests/main.nix index 0a69c0fe..3403a285 100644 --- a/tests/main.nix +++ b/tests/main.nix @@ -6,17 +6,11 @@ pkgs, self, system, + pkgsForTest, }: let fetchTests = callTest ./fetch-tests.nix { }; - # Use a single common instance of nixpkgs, with allowUnfree - # Having a single shared instance should speed up tests a little - pkgsForTest = import self.inputs.nixpkgs { - inherit system; - config.allowUnfree = true; - }; - moduleToTest = file: name: module: let