on hkm/ghc864 help sign in
haskell.nix/flake.nix
36 lines 1.3 kB history raw
1{
2 description = "Alternative Haskell Infrastructure for Nixpkgs";
4 edition = 201909;
6 outputs = { self }: {
7 # Using the eval-on-build version here as the plan is that
8 # `builtins.currentSystem` will not be supported in flakes.
9 # https://github.com/NixOS/rfcs/pull/49/files#diff-a5a138ca225433534de8d260f225fe31R429
10 overlay = (self.overlays {}).combined-eval-on-build;
11 overlays = import ./overlays;
12 config = import ./config.nix;
13 # We can't import ./nix/sources.nix directly, because that uses nixpkgs to fetch by default,
14 # and importing nixpkgs without specifying localSystem doesn't work on flakes.
15 sources = let
16 sourcesInfo =
17 builtins.fromJSON (builtins.readFile ./nix/sources.json);
18 fetch = sourceInfo:
19 builtins.fetchTarball { inherit (sourceInfo) url sha256; };
20 in builtins.mapAttrs (_: fetch) sourcesInfo;
22 nixpkgsArgs = {
23 inherit (self) config;
24 overlays = [ self.overlay ];
25 };
26 legacyPackages = let
27 genAttrs = lst: f:
28 builtins.listToAttrs (map (name: {
29 inherit name;
30 value = f name;
31 }) lst);
32 in genAttrs [ "x86_64-linux" "x86_64-darwin" ] (system:
33 import self.sources.nixpkgs
34 (self.nixpkgsArgs // { localSystem = { inherit system; }; }));
35 };