forked from cardano-foundation/cardano-graphql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
75 lines (65 loc) · 2.91 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
71
72
73
74
75
# This file is used by nix-shell.
# It just takes the shell attribute from default.nix.
{ config ? {}
, sourcesOverride ? {}
, pkgs ? import ./nix/pkgs.nix {}
}:
with pkgs;
let
# This provides a development environment that can be used with nix-shell
shell = pkgs.mkShell {
name = "cardano-graphql-dev-shell";
# These programs will be available inside the nix-shell.
buildInputs = [
git # Distributed version control system
go # The Go Programming language
packages.niv # Dependency management for Nix projects
nix # Purely Functional Package Manager
nodePackages.node2nix # Generates a set of Nix expressions from a NPM package's package.json
packages.nodejs # Event-driven I/O framework for the V8 JavaScript engine
packages.cardano-graphql
pkgconfig # Allows packages to find out information about other packages
pkgs.packages.persistgraphql
pkgs.packages.hasura-cli
python # The Python Programming language
tmux # Terminal multiplexer
yarn # Dependency management for javascript
packages.vgo2nix # Convert go.mod files to nixpkgs buildGoPackage compatible deps.nix files
yarn2nix-moretea.yarn2nix # Converts yarn.lock files into nix expression
];
shellHook = ''
source <(hasura completion bash)
echo "Cardano Graphql Dev 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"
echo "Commands:
* niv update <package> - update package
* persistgraphql <src> whitelist.json - generates a whitelist.json to limit graphql queries
* export GOPATH="\$\(pwd\)/.go" - enable vgo2nix to use the pwd as it's source
* node2nix -l - update node packages, -l if there's a lock file
"
'';
};
devops = pkgs.stdenv.mkDerivation {
name = "devops-shell";
buildInputs = [
niv # Dependency management for Nix projects
nodePackages.node2nix # Generates a set of Nix expressions from a NPM package's package.json
packages.vgo2nix # Convert go.mod files to nixpkgs buildGoPackage compatible deps.nix files
yarn2nix-moretea.yarn2nix # Converts yarn.lock files into nix expression
];
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"
echo "Commands:
* niv update <package> - update package
* export GOPATH="\$\(pwd\)/.go" - enable vgo2nix to use the pwd as it's source
* node2nix -l - update node packages, -l if there's a lock file
"
'';
};
in
shell // { inherit devops; }