on iko/ghcjs-patch-master help sign in
Remove some flake specifics that can mess-up caching. (#1176)
531c9f4Jean-Baptiste Giraudeau
@@ -2,7 +2,7 @@
2, system ? builtins.currentSystem
2, system ? builtins.currentSystem
3, sourcesOverride ? {}
3, sourcesOverride ? {}
4, ... }@args: rec {
4, ... }@args: rec {
5− sources = (import ./nix/sources.nix) // sourcesOverride;
5+ sources = (import ./nix/sources.nix { inherit pkgs; }) // sourcesOverride;
6 config = import ./config.nix;
6 config = import ./config.nix;
7 overlays = [ allOverlays.combined ] ++ (
7 overlays = [ allOverlays.combined ] ++ (
8 if checkMaterialization == true
8 if checkMaterialization == true
@@ -14,14 +14,7 @@
14 }
14 }
15 )]
15 )]
16 else []
16 else []
17− ) ++ [(
18− final: prev: {
19− haskell-nix = prev.haskell-nix // {
20− inherit overlays;
21− sources = prev.haskell-nix.sources // sourcesOverride;
22− };
23− }
24− )];
17+ );
25 allOverlays = import ./overlays args;
18 allOverlays = import ./overlays args;
26 nixpkgsArgs = { inherit config overlays system; };
19 nixpkgsArgs = { inherit config overlays system; };
27 pkgs = import sources.nixpkgs nixpkgsArgs;
20 pkgs = import sources.nixpkgs nixpkgsArgs;
flake.nix+1−7
@@ -14,21 +14,15 @@
14
14
15 internal = rec {
15 internal = rec {
16 config = import ./config.nix;
16 config = import ./config.nix;
17− # Use a shim for pkgs that does not depend on `builtins.currentSystem`.
18− sources = import ./nix/sources.nix {
19− pkgs = { fetchzip = builtins.fetchTarball; };
20− };
21
17
22 nixpkgsArgs = {
18 nixpkgsArgs = {
23 inherit config;
19 inherit config;
24 overlays = [ self.overlay ];
20 overlays = [ self.overlay ];
25 };
21 };
26−
27− overlaysOverrideable = import ./overlays;
28 };
22 };
29
23
30 overlay = self.overlays.combined;
24 overlay = self.overlays.combined;
31− overlays = self.internal.overlaysOverrideable { sourcesOverride = self.internal.sources; };
25+ overlays = import ./overlays {};
32
26
33 legacyPackages = let
27 legacyPackages = let
34 genAttrs = lst: f:
28 genAttrs = lst: f:
nix/sources.json+1−1
@@ -92,7 +92,7 @@
92 },
92 },
93 "nixpkgs": {
93 "nixpkgs": {
94 "branch": "nixpkgs-21.05-darwin",
94 "branch": "nixpkgs-21.05-darwin",
95− "builtin": false,
95+ "builtin": true,
96 "description": "Nix Packages collection",
96 "description": "Nix Packages collection",
97 "homepage": null,
97 "homepage": null,
98 "owner": "NixOS",
98 "owner": "NixOS",
overlays/default.nix+1−1
@@ -19,7 +19,7 @@ let
19 nix-prefetch-git-minimal = import ./nix-prefetch-git-minimal.nix;
19 nix-prefetch-git-minimal = import ./nix-prefetch-git-minimal.nix;
20 gobject-introspection = import ./gobject-introspection.nix;
20 gobject-introspection = import ./gobject-introspection.nix;
21 hix = import ./hix.nix;
21 hix = import ./hix.nix;
22− eval-packages = import ./eval-packages.nix;
22+ eval-packages = import ./eval-packages.nix combined;
23 ghcjs = import ./ghcjs.nix;
23 ghcjs = import ./ghcjs.nix;
24 };
24 };
25
25
overlays/eval-packages.nix+6−8
@@ -1,4 +1,4 @@
1−final: prev: {
1+haskellNixOverlay: final: prev: {
2 # This overlay makes `evalPackages` is like `buildPackages`, but on
2 # This overlay makes `evalPackages` is like `buildPackages`, but on
3 # `builtins.currentSystem` (when not building a nix flake).
3 # `builtins.currentSystem` (when not building a nix flake).
4 # We do not pass the `config` or `overlays` (not in `final.haskell-nix.overlays`).
4 # We do not pass the `config` or `overlays` (not in `final.haskell-nix.overlays`).
@@ -6,11 +6,9 @@ final: prev: {
6 # derivations that use `evalPackages` (these should be eval time only derviations
6 # derivations that use `evalPackages` (these should be eval time only derviations
7 # used to build nix inputs for IFD, the generated nix should match and so derivations
7 # used to build nix inputs for IFD, the generated nix should match and so derivations
8 # that depend on the IFD should match).
8 # that depend on the IFD should match).
9− evalPackages =
9+ evalPackages = (import final.path {
10 # If we are building a flake there will be no currentSystem attribute
10 # If we are building a flake there will be no currentSystem attribute
11− if builtins ? currentSystem
11+ system = builtins.currentSystem or final.system;
12− then (import final.path {
12+ overlays = [ haskellNixOverlay ];
13− inherit (final.haskell-nix) overlays;
14− }).buildPackages
15− else final.buildPackages;
13+ }).buildPackages;
16−}
14+}
overlays/haskell.nix+3−3
@@ -30,7 +30,7 @@ final: prev: {
30 specJSON = stackageSourceJSON;
30 specJSON = stackageSourceJSON;
31 override = "stackage";
31 override = "stackage";
32 };
32 };
33− } // (import ../nix/sources.nix) // sourcesOverride;
33+ } // (import ../nix/sources.nix { pkgs = final; }) // sourcesOverride;
34
34
35 # We provide a `callPackage` function to consumers for
35 # We provide a `callPackage` function to consumers for
36 # convenience. We will however refrain from using it
36 # convenience. We will however refrain from using it
@@ -706,7 +706,7 @@ final: prev: {
706 , crossPlatforms ? p: []
706 , crossPlatforms ? p: []
707 }:
707 }:
708 let packageNames = project: builtins.attrNames (packages project.hsPkgs);
708 let packageNames = project: builtins.attrNames (packages project.hsPkgs);
709− packagesForProject = prefix: project:
709+ packagesForProject = prefix: project:
710 final.lib.concatMap (packageName:
710 final.lib.concatMap (packageName:
711 let package = project.hsPkgs.${packageName};
711 let package = project.hsPkgs.${packageName};
712 in final.lib.optional (package.components ? library)
712 in final.lib.optional (package.components ? library)
@@ -721,7 +721,7 @@ final: prev: {
721 { name = "${prefix}${packageName}:test:${n}"; value = v; })
721 { name = "${prefix}${packageName}:test:${n}"; value = v; })
722 (package.components.tests)
722 (package.components.tests)
723 ) (packageNames project);
723 ) (packageNames project);
724− checksForProject = prefix: project:
724+ checksForProject = prefix: project:
725 final.lib.concatMap (packageName:
725 final.lib.concatMap (packageName:
726 let package = project.hsPkgs.${packageName};
726 let package = project.hsPkgs.${packageName};
727 in final.lib.mapAttrsToList (n: v:
727 in final.lib.mapAttrsToList (n: v: