Skip to content

Commit d1eb5eb

Browse files
committed
feat: enable per-channel configuration and fix pkgs selection
1 parent 012761f commit d1eb5eb

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

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 mapAttrs mapAttrs' hasSuffix removeSuffix nameValuePair;
7+
inherit (core-inputs.nixpkgs.lib) assertMsg foldl filterAttrs const mapAttrs mapAttrs' hasSuffix removeSuffix nameValuePair 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

snowfall-lib/module/default.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ in {
6363
systems = args.systems or {};
6464

6565
lib = snowfall-lib.internal.system-lib;
66-
pkgs = user-inputs.self.pkgs.${system}.nixpkgs;
6766

6867
inputs = snowfall-lib.flake.without-src user-inputs;
6968
namespace = snowfall-config.namespace;

0 commit comments

Comments
 (0)