forked from IntersectMBO/cardano-db-sync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
70 lines (61 loc) · 1.71 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# This file is used by nix-shell.
# It just takes the shell attribute from default.nix.
{ config ? {}
, sourcesOverride ? {}
, withHoogle ? true
, customConfig ? {
inherit withHoogle;
}
, pkgs ? import ./nix {
inherit config sourcesOverride customConfig;
}
}:
with pkgs;
let
inherit (pkgs.customConfig) withHoogle;
commandHelp =
''
echo "
Commands:
* nix flake update --update-input <iohkNix|haskellNix> - update input
"
'';
# This provides a development environment that can be used with nix-shell or
# lorri. See https://input-output-hk.github.io/haskell.nix/user-guide/development/
shell = cardanoDbSyncProject.shellFor {
name = "cabal-dev-shell";
packages = ps: lib.attrValues (haskell-nix.haskellLib.selectProjectPackages ps);
# These programs will be available inside the nix-shell.
nativeBuildInputs = with haskellPackages; [
cabalWrapped
ghcid
hlint
stylish-haskell
weeder
nixWrapped
pkgconfig
sqlite-interactive
tmux
pkgs.git
];
# Prevents cabal from choosing alternate plans, so that
# *all* dependencies are provided by Nix.
exactDeps = true;
inherit withHoogle;
};
devops = pkgs.stdenv.mkDerivation {
name = "devops-shell";
nativeBuildInputs = [
nixWrapped
];
shellHook = ''
echo "DevOps Tools" \
| ${figlet}/bin/figlet -f banner -c \
| ${lolcat}/bin/lolcat
echo "NOTE: you may need to export GITHUB_TOKEN if you hit rate limits with niv flake update:"
echo ' edit ~/.config/nix/nix.conf and add line `access-tokens = "github.com=23ac...b289"`'
${commandHelp}
'';
};
in
shell // { inherit devops; }