From 6e6b22c456bd8252cb75332ca7cdda6fa5d47315 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Sat, 30 Nov 2024 23:41:00 -0500 Subject: [PATCH] feat: take into account the rest of config.nixpkgs --- lib/flake/default.nix | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/flake/default.nix b/lib/flake/default.nix index 7df96632..79d23ee4 100644 --- a/lib/flake/default.nix +++ b/lib/flake/default.nix @@ -3,15 +3,18 @@ inputs: rec { mkPkgs = { system, nixpkgs, + cfg ? {}, cudaSupport ? false, }: import nixpkgs { inherit system; - overlays = [inputs.self.overlays.build-failures]; - config = { - inherit cudaSupport; - allowUnfree = true; - }; + overlays = [inputs.self.overlays.build-failures] ++ (cfg.overlays or []); + config = + { + inherit cudaSupport; + allowUnfree = true; + } + // (cfg.config or {}); }; # Enable use of `nixpkgs.overlays` on both NixOS and NixOnDroid @@ -20,12 +23,13 @@ inputs: rec { system, }: ({config, ...}: let pkgs = mkPkgs { + cfg = config.nixpkgs; inherit system cudaSupport; inherit (inputs) nixpkgs; }; - inherit (pkgs.lib) composeManyExtensions mkForce; + inherit (pkgs.lib) mkForce; in { - _module.args.pkgs = mkForce (pkgs.extend (composeManyExtensions config.nixpkgs.overlays)); + _module.args.pkgs = mkForce pkgs; }); # Default system