on iko/ghcjs-patch-master help sign in
Fix flake by importing sources correctly (#797)
afbb245Alexander Bantyev
@@ -10,7 +10,15 @@
10 overlay = (self.overlays {}).combined-eval-on-build;
10 overlay = (self.overlays {}).combined-eval-on-build;
11 overlays = import ./overlays;
11 overlays = import ./overlays;
12 config = import ./config.nix;
12 config = import ./config.nix;
13− sources = import ./nixpkgs;
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;
21+
14 nixpkgsArgs = {
22 nixpkgsArgs = {
15 inherit (self) config;
23 inherit (self) config;
16 overlays = [ self.overlay ];
24 overlays = [ self.overlay ];