Skip to content

Commit 4054bdc

Browse files
committed
feat: Pass through individual channel configuration
Channel-specific configuration is now also passed through to flake-utils-plus.mkFlake, allowing channels to have distinct settings and allowing for channel selection for individual hosts.
1 parent c6238c8 commit 4054bdc

1 file changed

Lines changed: 18 additions & 7 deletions

File tree

snowfall-lib/flake/default.nix

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
snowfall-lib,
55
snowfall-config,
66
}: let
7-
inherit (core-inputs.nixpkgs.lib) assertMsg foldl filterAttrs const;
7+
inherit (core-inputs.nixpkgs.lib) const filterAttrs mapAttrs traceVal;
88
in rec {
99
flake = rec {
1010
## Remove the `self` attribute from an attribute set.
@@ -128,6 +128,7 @@ in rec {
128128
inherit namespace;
129129
extra-overlays = full-flake-options.extra-exported-overlays or {};
130130
};
131+
channels = full-flake-options.channels or {};
131132

132133
outputs-builder = channels: let
133134
user-outputs-builder =
@@ -172,12 +173,22 @@ in rec {
172173
darwinModules = darwin-modules;
173174
homeModules = home-modules;
174175

175-
channelsConfig = full-flake-options.channels-config or {};
176-
177-
channels.nixpkgs.overlaysBuilder = snowfall-lib.overlay.create-overlays-builder {
178-
inherit namespace;
179-
extra-overlays = full-flake-options.overlays or [];
180-
};
176+
channelsConfig =
177+
full-flake-options.channels-config
178+
or full-flake-options.channelsConfig
179+
or {};
180+
181+
channels =
182+
mapAttrs
183+
(channel: config:
184+
config
185+
// {
186+
overlaysBuilder = snowfall-lib.overlay.create-overlays-builder {
187+
inherit namespace;
188+
extra-overlays = full-flake-options.overlays or [];
189+
};
190+
})
191+
({nixpkgs = {};} // channels);
181192

182193
outputsBuilder = outputs-builder;
183194

0 commit comments

Comments
 (0)