mirror of
https://github.com/ilyakooo0/haskell.nix.git
synced 2024-09-11 06:55:40 +03:00
Remove some flake specifics that can mess-up caching. (#1176)
* Remove flake specific sourceOverride that mess-up caching. * Reduce evalPackages discrepency between flake/non-flake. * Remove dependency on <nixpkgs> when importing sources.nix
This commit is contained in:
parent
97421c99a9
commit
531c9f4cac
11
default.nix
11
default.nix
@ -2,7 +2,7 @@
|
||||
, system ? builtins.currentSystem
|
||||
, sourcesOverride ? {}
|
||||
, ... }@args: rec {
|
||||
sources = (import ./nix/sources.nix) // sourcesOverride;
|
||||
sources = (import ./nix/sources.nix { inherit pkgs; }) // sourcesOverride;
|
||||
config = import ./config.nix;
|
||||
overlays = [ allOverlays.combined ] ++ (
|
||||
if checkMaterialization == true
|
||||
@ -14,14 +14,7 @@
|
||||
}
|
||||
)]
|
||||
else []
|
||||
) ++ [(
|
||||
final: prev: {
|
||||
haskell-nix = prev.haskell-nix // {
|
||||
inherit overlays;
|
||||
sources = prev.haskell-nix.sources // sourcesOverride;
|
||||
};
|
||||
}
|
||||
)];
|
||||
);
|
||||
allOverlays = import ./overlays args;
|
||||
nixpkgsArgs = { inherit config overlays system; };
|
||||
pkgs = import sources.nixpkgs nixpkgsArgs;
|
||||
|
@ -14,21 +14,15 @@
|
||||
|
||||
internal = rec {
|
||||
config = import ./config.nix;
|
||||
# Use a shim for pkgs that does not depend on `builtins.currentSystem`.
|
||||
sources = import ./nix/sources.nix {
|
||||
pkgs = { fetchzip = builtins.fetchTarball; };
|
||||
};
|
||||
|
||||
nixpkgsArgs = {
|
||||
inherit config;
|
||||
overlays = [ self.overlay ];
|
||||
};
|
||||
|
||||
overlaysOverrideable = import ./overlays;
|
||||
};
|
||||
|
||||
overlay = self.overlays.combined;
|
||||
overlays = self.internal.overlaysOverrideable { sourcesOverride = self.internal.sources; };
|
||||
overlays = import ./overlays {};
|
||||
|
||||
legacyPackages = let
|
||||
genAttrs = lst: f:
|
||||
|
@ -92,7 +92,7 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"branch": "nixpkgs-21.05-darwin",
|
||||
"builtin": false,
|
||||
"builtin": true,
|
||||
"description": "Nix Packages collection",
|
||||
"homepage": null,
|
||||
"owner": "NixOS",
|
||||
|
@ -19,7 +19,7 @@ let
|
||||
nix-prefetch-git-minimal = import ./nix-prefetch-git-minimal.nix;
|
||||
gobject-introspection = import ./gobject-introspection.nix;
|
||||
hix = import ./hix.nix;
|
||||
eval-packages = import ./eval-packages.nix;
|
||||
eval-packages = import ./eval-packages.nix combined;
|
||||
ghcjs = import ./ghcjs.nix;
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
final: prev: {
|
||||
haskellNixOverlay: final: prev: {
|
||||
# This overlay makes `evalPackages` is like `buildPackages`, but on
|
||||
# `builtins.currentSystem` (when not building a nix flake).
|
||||
# We do not pass the `config` or `overlays` (not in `final.haskell-nix.overlays`).
|
||||
@ -6,11 +6,9 @@ final: prev: {
|
||||
# derivations that use `evalPackages` (these should be eval time only derviations
|
||||
# used to build nix inputs for IFD, the generated nix should match and so derivations
|
||||
# that depend on the IFD should match).
|
||||
evalPackages =
|
||||
evalPackages = (import final.path {
|
||||
# If we are building a flake there will be no currentSystem attribute
|
||||
if builtins ? currentSystem
|
||||
then (import final.path {
|
||||
inherit (final.haskell-nix) overlays;
|
||||
}).buildPackages
|
||||
else final.buildPackages;
|
||||
}
|
||||
system = builtins.currentSystem or final.system;
|
||||
overlays = [ haskellNixOverlay ];
|
||||
}).buildPackages;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ final: prev: {
|
||||
specJSON = stackageSourceJSON;
|
||||
override = "stackage";
|
||||
};
|
||||
} // (import ../nix/sources.nix) // sourcesOverride;
|
||||
} // (import ../nix/sources.nix { pkgs = final; }) // sourcesOverride;
|
||||
|
||||
# We provide a `callPackage` function to consumers for
|
||||
# convenience. We will however refrain from using it
|
||||
@ -706,7 +706,7 @@ final: prev: {
|
||||
, crossPlatforms ? p: []
|
||||
}:
|
||||
let packageNames = project: builtins.attrNames (packages project.hsPkgs);
|
||||
packagesForProject = prefix: project:
|
||||
packagesForProject = prefix: project:
|
||||
final.lib.concatMap (packageName:
|
||||
let package = project.hsPkgs.${packageName};
|
||||
in final.lib.optional (package.components ? library)
|
||||
@ -721,7 +721,7 @@ final: prev: {
|
||||
{ name = "${prefix}${packageName}:test:${n}"; value = v; })
|
||||
(package.components.tests)
|
||||
) (packageNames project);
|
||||
checksForProject = prefix: project:
|
||||
checksForProject = prefix: project:
|
||||
final.lib.concatMap (packageName:
|
||||
let package = project.hsPkgs.${packageName};
|
||||
in final.lib.mapAttrsToList (n: v:
|
||||
|
Loading…
Reference in New Issue
Block a user