Skip to content

Commit

Permalink
fix nix evaluation impurities
Browse files Browse the repository at this point in the history
  • Loading branch information
dermetfan committed Nov 24, 2022
1 parent 8f6da18 commit ebe80f0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 16 deletions.
32 changes: 19 additions & 13 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 @@ -57,12 +63,12 @@ let
# fetched binaries are the "standard" builds that people test. This should be
# fast as it mostly fetches Hydra (CI) caches without building much.
cardano-node = import
(pkgs.fetchgit {
(builtins.fetchGit {
url = "https://github.com/input-output-hk/cardano-node";
rev = "1.35.3";
sha256 = "020fwimsm24yblr1fmnwx240wj8r3x715p89cpjgnnd8axwf32p0";
ref = "purity";
rev = "56a7c0ba48e363a65bed4b876c7e14005eab878d";
})
{ };
{ 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 ebe80f0

Please sign in to comment.