2
0
Fork 0

Optionally pass extraOverlays through release.nix

This allows packages to be be overriden simultaneously for both builds
and tests.
This commit is contained in:
Emery Hemingway 2019-10-22 21:24:57 +02:00
parent d343e1ee7b
commit 1df76e3bca
3 changed files with 18 additions and 11 deletions

View File

@ -3,7 +3,7 @@
# SPDX-License-Identifier: LicenseRef-Hippocratic-1.1 # SPDX-License-Identifier: LicenseRef-Hippocratic-1.1
let let
pkgOverlay = self: super: nativeOverlay = self: super:
# Overlay of locally defined packages # Overlay of locally defined packages
with self; { with self; {
depot = callPackage ./depot { }; depot = callPackage ./depot { };
@ -19,7 +19,7 @@ let
toolchainOverlay = import ./toolchain-overlay; toolchainOverlay = import ./toolchain-overlay;
# Overlay of toolchain patches # Overlay of toolchain patches
in { nixpkgs ? import ./nixpkgs.nix, nim-overlay ? <nim-overlay> }: in { nixpkgs ? ../nixpkgs, nim-overlay ? <nim-overlay>, extraOverlays ? [] }:
import nixpkgs { import nixpkgs {
# Evaluate an overlayed Nixpkgs for a Genode target # Evaluate an overlayed Nixpkgs for a Genode target
@ -29,5 +29,5 @@ import nixpkgs {
isGenode = true; isGenode = true;
imports = [ ./platform.nix ]; imports = [ ./platform.nix ];
}; };
overlays = [ toolchainOverlay (import nim-overlay) pkgOverlay ]; overlays = [ toolchainOverlay nativeOverlay (import nim-overlay) ] ++ extraOverlays;
} }

View File

@ -6,10 +6,6 @@
, nim-overlay, prSrc }: , nim-overlay, prSrc }:
let let
release = import ../release.nix {
inherit dhall-haskell dhallNixpkgs dhallNixpkgsStaticLinux nixpkgs
genodepkgs nim-overlay;
};
prOverride = attrs: { prOverride = attrs: {
src = prSrc; src = prSrc;
@ -23,5 +19,15 @@ let
''; '';
}; };
in extraOverlays =
{ build.x86_64.solo5 = pkgs.solo5.overrideAttrs prOverride; } [ (self: super: { solo5 = super.solo5.overrideAttrs prOverride; }) ];
release = import ../release.nix {
inherit dhall-haskell dhallNixpkgs dhallNixpkgsStaticLinux nixpkgs
genodepkgs nim-overlay extraOverlays;
};
in {
build.x86_64.solo5 = release.build.x86_64.solo5;
tests.x86_64.nova.solo5 = release.tests.x86_64.nova.solo5;
}

View File

@ -2,7 +2,7 @@
# #
# SPDX-License-Identifier: LicenseRef-Hippocratic-1.1 # SPDX-License-Identifier: LicenseRef-Hippocratic-1.1
let dhallPinned = import ./dhallPinnedNixpkgs.nix; in let dhallPinned = import ../dhall-haskell/nix/pinnedNixpkgs.nix; in
{ genodepkgs ? ./default.nix { genodepkgs ? ./default.nix
, nixpkgs ? import ./nixpkgs.nix , nixpkgs ? import ./nixpkgs.nix
@ -10,10 +10,11 @@ let dhallPinned = import ./dhallPinnedNixpkgs.nix; in
, dhallNixpkgs ? dhallPinned.nixpkgs , dhallNixpkgs ? dhallPinned.nixpkgs
, dhallNixpkgsStaticLinux ? dhallPinned.nixpkgsStaticLinux , dhallNixpkgsStaticLinux ? dhallPinned.nixpkgsStaticLinux
, nim-overlay ? <nim-overlay> , nim-overlay ? <nim-overlay>
, extraOverlays ? []
}: }:
let let
pkgs = import genodepkgs { inherit nixpkgs nim-overlay; }; pkgs = import genodepkgs { inherit nixpkgs nim-overlay extraOverlays; };
dhall-haskell' = import (dhall-haskell + "/release.nix") { dhall-haskell' = import (dhall-haskell + "/release.nix") {
nixpkgs = dhallNixpkgs; nixpkgs = dhallNixpkgs;
nixpkgsStaticLinux = dhallNixpkgsStaticLinux; nixpkgsStaticLinux = dhallNixpkgsStaticLinux;