factor out pkgsFun as an optional argument

master
Adam Joseph 2 years ago
parent 7fa5116288
commit 5fa23513f9

@ -1,13 +1,15 @@
{ pkgsFun ? import <nixpkgs>
}:
let let
lib = import <nixpkgs/lib>; lib = import <nixpkgs/lib>;
nixpkgsArgs = { config.allowNonSource = false; }; nixpkgsArgs = { config.allowNonSource = false; };
nixpkgsOnBuildForBuild = import <nixpkgs> nixpkgsArgs; nixpkgsOnBuildForBuild = pkgsFun nixpkgsArgs;
ownerboot = { hostPlatform?null, overlay }: ownerboot = { hostPlatform?null, overlay }:
(lib.makeScope lib.callPackageWith (self: { (lib.makeScope lib.callPackageWith (self: {
inherit lib nixpkgsOnBuildForBuild; inherit lib nixpkgsOnBuildForBuild;
nixpkgsOnBuildForHost = import <nixpkgs> nixpkgsOnBuildForHost = pkgsFun
(nixpkgsArgs // (lib.optionalAttrs (hostPlatform!=null) { (nixpkgsArgs // (lib.optionalAttrs (hostPlatform!=null) {
crossSystem = hostPlatform; })); crossSystem = hostPlatform; }));

Loading…
Cancel
Save