feat: take into account the rest of config.nixpkgs
This commit is contained in:
parent
1ae537b572
commit
6e6b22c456
1 changed files with 11 additions and 7 deletions
|
@ -3,15 +3,18 @@ inputs: rec {
|
||||||
mkPkgs = {
|
mkPkgs = {
|
||||||
system,
|
system,
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
|
cfg ? {},
|
||||||
cudaSupport ? false,
|
cudaSupport ? false,
|
||||||
}:
|
}:
|
||||||
import nixpkgs {
|
import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
overlays = [inputs.self.overlays.build-failures];
|
overlays = [inputs.self.overlays.build-failures] ++ (cfg.overlays or []);
|
||||||
config = {
|
config =
|
||||||
inherit cudaSupport;
|
{
|
||||||
allowUnfree = true;
|
inherit cudaSupport;
|
||||||
};
|
allowUnfree = true;
|
||||||
|
}
|
||||||
|
// (cfg.config or {});
|
||||||
};
|
};
|
||||||
|
|
||||||
# Enable use of `nixpkgs.overlays` on both NixOS and NixOnDroid
|
# Enable use of `nixpkgs.overlays` on both NixOS and NixOnDroid
|
||||||
|
@ -20,12 +23,13 @@ inputs: rec {
|
||||||
system,
|
system,
|
||||||
}: ({config, ...}: let
|
}: ({config, ...}: let
|
||||||
pkgs = mkPkgs {
|
pkgs = mkPkgs {
|
||||||
|
cfg = config.nixpkgs;
|
||||||
inherit system cudaSupport;
|
inherit system cudaSupport;
|
||||||
inherit (inputs) nixpkgs;
|
inherit (inputs) nixpkgs;
|
||||||
};
|
};
|
||||||
inherit (pkgs.lib) composeManyExtensions mkForce;
|
inherit (pkgs.lib) mkForce;
|
||||||
in {
|
in {
|
||||||
_module.args.pkgs = mkForce (pkgs.extend (composeManyExtensions config.nixpkgs.overlays));
|
_module.args.pkgs = mkForce pkgs;
|
||||||
});
|
});
|
||||||
|
|
||||||
# Default system
|
# Default system
|
||||||
|
|
Loading…
Reference in a new issue