-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathshell.nix
More file actions
46 lines (42 loc) · 1.34 KB
/
shell.nix
File metadata and controls
46 lines (42 loc) · 1.34 KB
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
{ }:
let
pkgs = import ./nix/nixpkgs.nix {};
project = (import ./default.nix { inherit pkgs; useMuslIfPossible = false; }).project;
postgres = pkgs.postgresql_16.withPackages (ps: with ps; [ pg_cron ]);
in
project.shellFor {
tools = {
cabal = "latest";
hlint = "latest";
haskell-language-server = "latest";
fourmolu = "latest";
};
exactDeps = true;
buildInputs =
with pkgs;
[
cacert
concurrently
ghcid
glibcLocales
hyperfine
postgres
nix-prefetch-docker
podman
run
shellcheck
]
++ pkgs.lib.optionals pkgs.stdenv.isLinux [ strace ];
shellHook = ''
source scripts/source-env.sh .env
# Postgres 15 insists in appearing in PATH before postgres 16.
# So we add postgres 16 _again_ to the beginning of the PATH, and also some useful scripts
export PATH="${postgres}/bin:$PATH:scripts/path"
# I tried to daemonize starting postgres but was not able
# to make it work, so we only init the cluster.
# See https://github.com/direnv/direnv/issues/755
./scripts/init-pg-cluster.sh ./conf/dev-db
echo You should be able to start postgres with 'pg_ctl start' and use 'psql' to connect to it, and it will be independent from any your own system might have provided.
echo If 'psql' fails to connect, check logs at $PGDATA/log/
'';
}