Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

Commit bec3c7b

Browse files
committed
Fix nix-shells.
1 parent 8abdbe4 commit bec3c7b

File tree

3 files changed

+21
-25
lines changed

3 files changed

+21
-25
lines changed

default.nix

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,28 @@ in
4141
# parameterize this file when targetting different
4242
# hosts.
4343
{ system ? builtins.currentSystem
44-
, config ? {}, ... }@args:
44+
, config ? {}
45+
, pkgs ? commonLib.getPkgs { inherit config system; }
46+
, ... }@args:
4547
# We will instantiate the default-nix template with the
4648
# nix/pkgs.nix file...
4749
commonLib.nix-tools.default-nix ./nix/pkgs.nix args
4850
# ... and add additional non-haskell packages we want to build on CI:
4951
// {
50-
cardano-shell-env = (import ./stack-shell.nix { inherit config system; });
52+
53+
stack-env = pkgs.runCommand "stack-env" {
54+
buildInputs = with pkgs; [ haskell.packages.ghc863.ghc zlib openssl git ];
55+
} "mkdir $out";
56+
57+
runCoveralls = pkgs.stdenv.mkDerivation {
58+
name = "run-coveralls";
59+
buildInputs = with pkgs; [ haskellPackages.stack-hpc-coveralls stack ];
60+
shellHook = ''
61+
echo '~~~ stack test'
62+
stack test --coverage
63+
echo '~~~ shc'
64+
shc --repo-token=$COVERALLS_REPO_TOKEN cardano-shell cardano-shell-test
65+
exit
66+
'';
67+
};
5168
}

shell.nix

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,9 @@
1-
let
2-
commonLib = import ./nix/iohk-common.nix;
3-
in
41
{ system ? builtins.currentSystem
52
, config ? {}
63
, localPkgs ? import ./. { inherit config system; }
7-
, pkgs ? commonLib.getPkgs { inherit config system; }
84
}:
95
let
106
mainShell = localPkgs.nix-tools.libs.cardano-shell.env;
11-
runCoveralls = pkgs.stdenv.mkDerivation {
12-
name = "run-coveralls";
13-
buildInputs = [ pkgs.haskellPackages.stack-hpc-coveralls pkgs.stack ];
14-
shellHook = ''
15-
echo '~~~ stack test'
16-
stack test --coverage
17-
echo '~~~ shc'
18-
shc --repo-token=$COVERALLS_REPO_TOKEN cardano-shell cardano-shell-test
19-
exit
20-
'';
21-
};
227
in mainShell // {
23-
inherit runCoveralls;
8+
inherit (localPkgs) runCoveralls;
249
}

stack-shell.nix

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
{ system ? builtins.currentSystem
22
, config ? {}
3-
, localPkgs ? import ./. { inherit config system; }
4-
, pkgs ? localPkgs._lib.getPkgs { inherit config system; }
53
}:
6-
with pkgs; haskell.lib.buildStackProject {
7-
name = "cardano-shell-env";
8-
buildInputs = [ zlib openssl git ];
9-
ghc = haskell.packages.ghc863.ghc;
10-
}
4+
(import ./default.nix { inherit system config; }).stack-env

0 commit comments

Comments
 (0)