From 0992b38e5e1f3fba5cf7d386a20a39ce8ea6ee3f Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sun, 3 Mar 2024 06:55:43 +0100 Subject: [PATCH] tests: add mkStubPackage in Nixpkgs overlay --- tests/stubs.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/stubs.nix b/tests/stubs.nix index e9ecbed70..b9c933ac8 100644 --- a/tests/stubs.nix +++ b/tests/stubs.nix @@ -70,12 +70,11 @@ in { config = { lib.test.mkStubPackage = mkStubPackage; - nixpkgs.overlays = mkIf (config.test.stubs != { }) [ - (self: super: + nixpkgs.overlays = [ (self: super: { inherit mkStubPackage; }) ] + ++ optional (config.test.stubs != { }) (self: super: mapAttrs (n: v: mkStubPackage (v // optionalAttrs (v.version == null) { version = super.${n}.version or null; - })) config.test.stubs) - ]; + })) config.test.stubs); }; }