Skip to content

Commit

Permalink
fix nix evaluation impurities
Browse files Browse the repository at this point in the history
  • Loading branch information
dermetfan authored and ch1bo committed Nov 29, 2022
1 parent 6e3b7f2 commit bdfa927
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
26 changes: 16 additions & 10 deletions default.nix
Expand Up @@ -3,24 +3,30 @@
, system ? builtins.currentSystem

, haskellNix ? import
(builtins.fetchTarball
"https://github.com/input-output-hk/haskell.nix/archive/0.0.64.tar.gz")
{ }
(builtins.fetchTarball {
url = "https://github.com/input-output-hk/haskell.nix/archive/0.0.64.tar.gz";
sha256 = "0mply6n3gym8r7z4l7512phw667qzwfqkfl1zmiyrdjpdg7xqn1d";
})
{ pkgs = import nixpkgsSrc { inherit system; }; }

, iohkNix ? import
(builtins.fetchTarball
"https://github.com/input-output-hk/iohk-nix/archive/d31417fe8c8fbfb697b3ad4c498e17eb046874b9.tar.gz")
(builtins.fetchTarball {
url = "https://github.com/input-output-hk/iohk-nix/archive/d31417fe8c8fbfb697b3ad4c498e17eb046874b9.tar.gz";
sha256 = "0w562wdmdhp83dw9rabiijj5hk1f4l8p8f3bwlr7virakgbg8lf8";
})
{ }

# NOTE: use the 'repo' branch of CHaP which contains the index
, CHaP ? (builtins.fetchTarball
"https://github.com/input-output-hk/cardano-haskell-packages/archive/ceaae5355c81453d7cb092acadec3441bf57ed11.tar.gz")
, CHaP ? (builtins.fetchTarball {
url = "https://github.com/input-output-hk/cardano-haskell-packages/archive/ceaae5355c81453d7cb092acadec3441bf57ed11.tar.gz";
sha256 = "0pwlfv2gx7h2z492bfhbr6pakidi5i8dzpc4094sb05i9rrgyq32";
})

# nixpkgs-unstable as also used by cardano-node, cardano-ledger et al
, nixpkgsSrc ? haskellNix.sources.nixpkgs-unstable
, nixpkgsSrc ? iohkNix.nixpkgs
}:
let
pkgs = import nixpkgsSrc (haskellNix.nixpkgsArgs // {
inherit system;
overlays =
# Haskell.nix (https://github.com/input-output-hk/haskell.nix)
haskellNix.overlays
Expand Down Expand Up @@ -62,7 +68,7 @@ let
rev = "1.35.4";
sha256 = "1j01m2cp2vdcl26zx9xmipr551v3b2rz9kfn9ik8byfwj1z7652r";
})
{ };
{ inherit system; };
in
{
inherit compiler pkgs hsPkgs cardano-node;
Expand Down
5 changes: 3 additions & 2 deletions release.nix
Expand Up @@ -3,10 +3,11 @@
{
# this is passed in by hydra to provide us with the revision
hydra ? { outPath = ./.; rev = "abcdef"; }
, system ? builtins.currentSystem
, ...
}:
let
project = import ./default.nix { };
project = import ./default.nix { inherit system; };
nativePkgs = project.hsPkgs;
# Allow reinstallation of terminfo as it's not installed with cross compilers.
patchedForCrossProject = project.hsPkgs.appendModule
Expand All @@ -15,7 +16,7 @@ let
in
rec {
# Build shell derivation to cache it
shell = import ./shell.nix { };
shell = import ./shell.nix { inherit system; };

# Build some executables
hydra-node = nativePkgs.hydra-node.components.exes.hydra-node;
Expand Down
3 changes: 2 additions & 1 deletion shell.nix
Expand Up @@ -5,9 +5,10 @@
{
# Used in CI to have a smaller closure
withoutDevTools ? false
, system ? builtins.currentSystem
}:
let
project = import ./default.nix { };
project = import ./default.nix { inherit system; };
inherit (project) compiler pkgs hsPkgs cardano-node;

libs = [
Expand Down

0 comments on commit bdfa927

Please sign in to comment.