on iko/ghcjs-patch-master help sign in
Fix flake by importing sources correctly (#797)
commitafbb245fa81dcb4f5c61888a0f87e4ece0564aba authorAlexander Bantyev <balsoft@balsoft.ru> dateTue 4 Aug 2020, 08:26 (6 years ago) parent2162bea
1 file changed+9−1
flake.nix+9−1
flake.nix+9−1
@@ -10,7 +10,15 @@
1010 overlay = (self.overlays {}).combined-eval-on-build;
1111 overlays = import ./overlays;
1212 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+
1422 nixpkgsArgs = {
1523 inherit (self) config;
1624 overlays = [ self.overlay ];