-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
43 lines (36 loc) · 938 Bytes
/
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
with (import ./default.nix);
pkgs.mkShell {
name = "${settings.binPrefix}env";
buildInputs = [
api
db
deployLocal
ingress
webapp
tests
docs
nixpkgsUpdate.bin
python
autoformat.bin
pkgs.curl
pkgs.elmPackages.elm
pkgs.elmPackages.elm-test
pkgs.silver-searcher
pkgs.cabal2nix
];
shellHook = ''
tmpdir="$(mktemp -d)"
trap 'rm -rf $tmpdir' exit
port="$(${randomfreeport})"
source "$(${deployLocal.mkEnv} . "$tmpdir" "$port")"
echo "${settings.appName} set up in ${settings.dir} and ${settings.URI}"
alias ${settings.binPrefix}open="xdg-open ${settings.URI}"
# psql variables for convenience
export PGHOST="${settings.dbHost}"
export PGDATABASE="${settings.dbName}"
export PGUSER="${settings.dbSuperuser}"
export PGPASSWORD="${settings.dbSuperuserPassword}"
# disable line wrap in psql
export PAGER="less -S"
'';
}