2020-05-07 02:16:38 +03:00
|
|
|
{
|
|
|
|
description = "Alternative Haskell Infrastructure for Nixpkgs";
|
|
|
|
|
2021-02-22 09:11:58 +03:00
|
|
|
outputs = { self }:
|
|
|
|
{
|
2020-08-04 08:26:56 +03:00
|
|
|
|
2021-02-22 09:11:58 +03:00
|
|
|
internal = rec {
|
|
|
|
config = import ./config.nix;
|
|
|
|
# We can't import ./nix/sources.nix directly, because that uses nixpkgs to fetch by default,
|
|
|
|
# and importing nixpkgs without specifying localSystem doesn't work on flakes.
|
|
|
|
sources = let
|
|
|
|
sourcesInfo =
|
|
|
|
builtins.fromJSON (builtins.readFile ./nix/sources.json);
|
|
|
|
fetch = sourceInfo:
|
|
|
|
builtins.fetchTarball { inherit (sourceInfo) url sha256; };
|
|
|
|
in builtins.mapAttrs (_: fetch) sourcesInfo;
|
|
|
|
|
|
|
|
nixpkgsArgs = {
|
|
|
|
inherit config;
|
|
|
|
overlays = [ self.overlay ];
|
|
|
|
};
|
|
|
|
|
|
|
|
overlaysOverrideable = import ./overlays;
|
2020-05-07 02:16:38 +03:00
|
|
|
};
|
2021-02-22 09:11:58 +03:00
|
|
|
|
2020-12-02 12:31:09 +03:00
|
|
|
# Using the eval-on-build version here as the plan is that
|
|
|
|
# `builtins.currentSystem` will not be supported in flakes.
|
|
|
|
# https://github.com/NixOS/rfcs/pull/49/files#diff-a5a138ca225433534de8d260f225fe31R429
|
|
|
|
overlay = self.overlays.combined-eval-on-build;
|
2021-02-22 09:11:58 +03:00
|
|
|
overlays = self.internal.overlaysOverrideable { sourcesOverride = self.sources; };
|
|
|
|
|
2020-05-07 02:16:38 +03:00
|
|
|
legacyPackages = let
|
|
|
|
genAttrs = lst: f:
|
|
|
|
builtins.listToAttrs (map (name: {
|
|
|
|
inherit name;
|
|
|
|
value = f name;
|
|
|
|
}) lst);
|
|
|
|
in genAttrs [ "x86_64-linux" "x86_64-darwin" ] (system:
|
2021-02-22 09:11:58 +03:00
|
|
|
import self.internal.sources.nixpkgs
|
|
|
|
(self.internal.nixpkgsArgs // { localSystem = { inherit system; }; }));
|
2020-05-07 02:16:38 +03:00
|
|
|
};
|
|
|
|
}
|