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

Use new shellFor function to provide build env. #174

Merged
merged 2 commits into from
May 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,31 @@ in
# parameterize this file when targetting different
# hosts.
{ system ? builtins.currentSystem
, crossSystem ? null
, config ? {}
, pkgs ? commonLib.getPkgs { inherit config system; }
, ... }@args:
# We will instantiate the default-nix template with the
# nix/pkgs.nix file...
commonLib.nix-tools.default-nix ./nix/pkgs.nix args
# ... and add additional non-haskell packages we want to build on CI:
// {
, pkgs ? commonLib.getPkgs { inherit config crossSystem system; }
, withHoogle ? true
}:
let
# We will instantiate the default-nix template with the
# nix/pkgs.nix file...
defaultNix = commonLib.nix-tools.default-nix ./nix/pkgs.nix {
inherit system crossSystem config pkgs;
};
in defaultNix // {
# ... and add additional packages we want to build on CI:

env = defaultNix.nix-tools.shellFor {
inherit withHoogle;
# env will provide the dependencies of cardano-shell
packages = ps: with ps; [ cardano-shell ];
Copy link
Contributor

@ksaric ksaric May 31, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have the stack coveralls package (stack-hpc-coveralls) dependency somewhere in the default package set? If not, it would be useful, since we could all have the same version and run the same thing.
#171 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do (defined in iohk-nix). I added it to the default nix-shell.

# This adds git to the shell, which is used by stack.
buildInputs = with pkgs; [ git stack commonLib.stack-hpc-coveralls ];
};

runCoveralls = pkgs.stdenv.mkDerivation {
name = "run-coveralls";
buildInputs = with pkgs; [ haskellPackages.stack-hpc-coveralls stack ];
buildInputs = with pkgs; [ commonLib.stack-hpc-coveralls stack ];
shellHook = ''
echo '~~~ stack test'
stack test --coverage
Expand Down
6 changes: 3 additions & 3 deletions nix/iohk-nix-src.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"url": "https://github.com/input-output-hk/iohk-nix",
"rev": "5040e0192871203251ed404edb3c9259c18bc7e1",
"date": "2019-05-20T19:03:56-03:00",
"sha256": "1ah1njfj906068g0z10x5ldphcx4l1dx7y026vhmqyjhyqgml88q",
"rev": "8a7faeddf108515a8d64cb3dcf552bbd432865a3",
"date": "2019-05-31T03:32:45+00:00",
"sha256": "0cjsnzfnyhbvjvw9lk2z6bznjnpq452d629319km29yvqqg2n9yk",
"fetchSubmodules": false
}
2 changes: 1 addition & 1 deletion shell.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
let
localPkgs = import ./. { };
mainShell = localPkgs.nix-tools.libs.cardano-shell;
mainShell = localPkgs.env;
in mainShell // {
inherit (localPkgs) runCoveralls;
}
1 change: 1 addition & 0 deletions stack-shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(import ./. { withHoogle = false; }).env
3 changes: 1 addition & 2 deletions stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,4 @@ extra-deps:

nix:
enable: true
pure: false
shell-file: shell.nix
shell-file: stack-shell.nix