tests: add mkStubPackage in Nixpkgs overlay

This commit is contained in:
Robert Helgesson 2024-03-03 06:55:43 +01:00
parent 2f3367769a
commit 0992b38e5e
No known key found for this signature in database
GPG key ID: 96E745BD17AA17ED

View file

@ -70,12 +70,11 @@ in {
config = { config = {
lib.test.mkStubPackage = mkStubPackage; lib.test.mkStubPackage = mkStubPackage;
nixpkgs.overlays = mkIf (config.test.stubs != { }) [ nixpkgs.overlays = [ (self: super: { inherit mkStubPackage; }) ]
(self: super: ++ optional (config.test.stubs != { }) (self: super:
mapAttrs (n: v: mapAttrs (n: v:
mkStubPackage (v // optionalAttrs (v.version == null) { mkStubPackage (v // optionalAttrs (v.version == null) {
version = super.${n}.version or null; version = super.${n}.version or null;
})) config.test.stubs) })) config.test.stubs);
];
}; };
} }