forked from input-output-hk/iohk-ops
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell.nix
46 lines (45 loc) · 1.22 KB
/
shell.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{ localLib ? import ./lib.nix
, pkgs ? import (localLib.fetchNixPkgs) {}
}:
let
iohkpkgs = import ./default.nix {};
iohk-ops = iohkpkgs.iohk-ops;
justIo = pkgs.mkShell {
name = "io";
buildInputs = with pkgs; [ iohk-ops terraform_0_11 iohkpkgs.nixops cabal-install ];
passthru = {
inherit ioSelfBuild withAuxx;
};
shellHook = ioShellHook;
};
ioSelfBuild = pkgs.lib.overrideDerivation iohk-ops.env (drv: {
shellHook = ''
function io {
runhaskell -iiohk iohk/iohk-ops.hs "$@"
}
function ghcid-io {
${pkgs.haskellPackages.ghcid}/bin/ghcid -c "ghci -iiohk iohk/iohk-ops.hs"
}
'';
});
withAuxx = pkgs.mkShell {
name = "io-with-auxx";
buildInputs = [
iohk-ops
iohkpkgs.cardano-sl-auxx
iohkpkgs.cardano-sl-tools
# todo, switch run nix-shell to nix run
pkgs.bashInteractive
];
shellHook = ''
${ioShellHook}
for prog in cardano-keygen cardano-x509-certificates cardano-auxx; do
source <($prog --bash-completion-script `type -p $prog`)
done
'';
};
ioShellHook = ''
source <(iohk-ops --bash-completion-script `type -p iohk-ops`)
complete -o filenames -F _iohk-ops io
'';
in justIo