Skip to content

Commit 5d8a9ad

Browse files
committed
Rename plan-json projectNix
1 parent 0d6d9e5 commit 5d8a9ad

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

lib/call-cabal-project-to-nix.nix

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{ pkgs, runCommand, cacert, index-state-hashes, haskellLib }:
22
{ name ? src.name or null # optional name for better error messages
33
, src
4+
, materialized-dir ? ../materialized
45
, compiler-nix-name # The name of the ghc compiler to use eg. "ghc884"
56
, index-state ? null # Hackage index-state, eg. "2019-10-10T00:00:00Z"
67
, index-sha256 ? null # The hash of the truncated hackage index-state
@@ -698,6 +699,7 @@ let
698699
find $out -type d -empty -delete
699700
'');
700701
in {
701-
inherit plan-json index-state-max src;
702+
projectNix = plan-json;
703+
inherit index-state-max src;
702704
inherit (fixedProject) sourceRepos extra-hackages;
703705
}

overlays/haskell.nix

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ final: prev: {
646646
inherit (config) compiler-nix-name compilerSelection evalPackages;
647647
selectedCompiler = (compilerSelection final.buildPackages).${compiler-nix-name};
648648

649-
plan-json = builtins.fromJSON (builtins.readFile (callProjectResults.plan-json + "/plan.json"));
649+
plan-json = builtins.fromJSON (builtins.readFile (callProjectResults.projectNix + "/plan.json"));
650650
by-id = final.lib.listToAttrs (map (x: { name = x.id; value = x; }) plan-json.install-plan);
651651
to-key = p: if p.type == "pre-existing"
652652
then p.pkg-name
@@ -682,12 +682,11 @@ final: prev: {
682682
};
683683
};
684684
callProjectResults = callCabalProjectToNix config;
685-
plan-pkgs = if !builtins.pathExists (callProjectResults.plan-json + "/plan.json")
685+
plan-pkgs = if !builtins.pathExists (callProjectResults.projectNix + "/plan.json")
686686
then
687687
# TODO remove this once all the materialized files are updated
688688
importAndFilterProject {
689-
projectNix = callProjectResults.plan-json;
690-
inherit (callProjectResults) sourceRepos src;
689+
inherit (callProjectResults) projectNix sourceRepos src;
691690
}
692691
else {
693692
pkgs = (hackage: {
@@ -697,8 +696,8 @@ final: prev: {
697696
name = to-key p;
698697
value.revision =
699698
{hsPkgs, ...}@args:
700-
let cabal2nix = (if builtins.pathExists (callProjectResults.plan-json + "/cabal-files/${p.pkg-name}.nix")
701-
then import (callProjectResults.plan-json + "/cabal-files/${p.pkg-name}.nix")
699+
let cabal2nix = (if builtins.pathExists (callProjectResults.projectNix + "/cabal-files/${p.pkg-name}.nix")
700+
then import (callProjectResults.projectNix + "/cabal-files/${p.pkg-name}.nix")
702701
else (((hackage.${p.pkg-name}).${p.pkg-version}).revisions).default) (args // { hsPkgs = {}; });
703702
in cabal2nix // {
704703
flags = p.flags;
@@ -720,7 +719,7 @@ final: prev: {
720719
name = to-key p;
721720
value =
722721
{hsPkgs, ...}@args:
723-
let cabal2nix = import (callProjectResults.plan-json + "/.plan.nix/${p.pkg-name}.nix") (args // { hsPkgs = {}; });
722+
let cabal2nix = import (callProjectResults.projectNix + "/.plan.nix/${p.pkg-name}.nix") (args // { hsPkgs = {}; });
724723
in builtins.removeAttrs cabal2nix ["src"] // {
725724
flags = p.flags;
726725
components = getComponents cabal2nix.components hsPkgs p;

0 commit comments

Comments
 (0)