@@ -1,27 +1,34 @@
2 description = "Alternative Haskell Infrastructure for Nixpkgs";
2 description = "Alternative Haskell Infrastructure for Nixpkgs";
4− outputs = { self }: let
4+ outputs = { self }:
5− config = import ./config.nix;
5+ {
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.
10− builtins.fromJSON (builtins.readFile ./nix/sources.json);
12− builtins.fetchTarball { inherit (sourceInfo) url sha256; };
13− in builtins.mapAttrs (_: fetch) sourcesInfo;
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.
13+ builtins.fromJSON (builtins.readFile ./nix/sources.json);
15+ builtins.fetchTarball { inherit (sourceInfo) url sha256; };
16+ in builtins.mapAttrs (_: fetch) sourcesInfo;
15− nixpkgsArgs = {
18+ nixpkgsArgs = {
16− inherit config;
19+ inherit config;
17− overlays = [ self.overlay ];
20+ overlays = [ self.overlay ];
23+ overlaysOverrideable = import ./overlays;
20 # Using the eval-on-build version here as the plan is that
26 # Using the eval-on-build version here as the plan is that
21 # `builtins.currentSystem` will not be supported in flakes.
27 # `builtins.currentSystem` will not be supported in flakes.
22 # https://github.com/NixOS/rfcs/pull/49/files#diff-a5a138ca225433534de8d260f225fe31R429
28 # https://github.com/NixOS/rfcs/pull/49/files#diff-a5a138ca225433534de8d260f225fe31R429
23 overlay = self.overlays.combined-eval-on-build;
29 overlay = self.overlays.combined-eval-on-build;
24− overlays = import ./overlays { sourcesOverride = sources; };
30+ overlays = self.internal.overlaysOverrideable { sourcesOverride = self.sources; };
25 legacyPackages = let
32 legacyPackages = let
26 genAttrs = lst: f:
33 genAttrs = lst: f:
27 builtins.listToAttrs (map (name: {
34 builtins.listToAttrs (map (name: {
@@ -29,7 +36,7 @@
29 value = f name;
36 value = f name;
31 in genAttrs [ "x86_64-linux" "x86_64-darwin" ] (system:
38 in genAttrs [ "x86_64-linux" "x86_64-darwin" ] (system:
32− import sources.nixpkgs
39+ import self.internal.sources.nixpkgs
33− (nixpkgsArgs // { localSystem = { inherit system; }; }));
40+ (self.internal.nixpkgsArgs // { localSystem = { inherit system; }; }));