@@ -1,27 +1,34 @@
11{
22 description = "Alternative Haskell Infrastructure for Nixpkgs";
33
4− outputs = { self }: let
5− config = import ./config.nix;
6− # We can't import ./nix/sources.nix directly, because that uses nixpkgs to fetch by default,
7− # and importing nixpkgs without specifying localSystem doesn't work on flakes.
8− sources = let
9− sourcesInfo =
10− builtins.fromJSON (builtins.readFile ./nix/sources.json);
11− fetch = sourceInfo:
12− builtins.fetchTarball { inherit (sourceInfo) url sha256; };
13− in builtins.mapAttrs (_: fetch) sourcesInfo;
4+ outputs = { self }:
5+ {
146
15− nixpkgsArgs = {
16− inherit config;
17− overlays = [ self.overlay ];
7+ internal = rec {
8+ config = import ./config.nix;
9+ # We can't import ./nix/sources.nix directly, because that uses nixpkgs to fetch by default,
10+ # and importing nixpkgs without specifying localSystem doesn't work on flakes.
11+ sources = let
12+ sourcesInfo =
13+ builtins.fromJSON (builtins.readFile ./nix/sources.json);
14+ fetch = sourceInfo:
15+ builtins.fetchTarball { inherit (sourceInfo) url sha256; };
16+ in builtins.mapAttrs (_: fetch) sourcesInfo;
17+
18+ nixpkgsArgs = {
19+ inherit config;
20+ overlays = [ self.overlay ];
21+ };
22+
23+ overlaysOverrideable = import ./overlays;
1824 };
19− in {
25+
2026 # Using the eval-on-build version here as the plan is that
2127 # `builtins.currentSystem` will not be supported in flakes.
2228 # https://github.com/NixOS/rfcs/pull/49/files#diff-a5a138ca225433534de8d260f225fe31R429
2329 overlay = self.overlays.combined-eval-on-build;
24− overlays = import ./overlays { sourcesOverride = sources; };
30+ overlays = self.internal.overlaysOverrideable { sourcesOverride = self.sources; };
31+
2532 legacyPackages = let
2633 genAttrs = lst: f:
2734 builtins.listToAttrs (map (name: {
@@ -29,7 +36,7 @@
2936 value = f name;
3037 }) lst);
3138 in genAttrs [ "x86_64-linux" "x86_64-darwin" ] (system:
32− import sources.nixpkgs
33− (nixpkgsArgs // { localSystem = { inherit system; }; }));
39+ import self.internal.sources.nixpkgs
40+ (self.internal.nixpkgsArgs // { localSystem = { inherit system; }; }));
3441 };
3542}