-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathshell.nix
More file actions
67 lines (60 loc) · 2.06 KB
/
Copy pathshell.nix
File metadata and controls
67 lines (60 loc) · 2.06 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# The additional modules below have large dependencies and are therefore
# disabled by default. You can activate them by passing arguments to nix-shell,
# e.g.:
#
# nix-shell --arg docker true
#
# We highly recommend that use the PostgREST binary cache by installing cachix
# (https://app.cachix.org/) and running `cachix use postgrest`.
{
docker ? false,
postgrest ? import ./default.nix { },
}:
let
inherit (postgrest) pkgs;
inherit (pkgs) lib;
toolboxes = [
postgrest.cabalTools
postgrest.devTools
postgrest.docs
postgrest.gitTools
postgrest.loadtest
postgrest.nixpkgsTools
postgrest.release
postgrest.tests
postgrest.withTools
]
++ lib.optional docker postgrest.docker;
in
lib.overrideDerivation postgrest.env (base: {
buildInputs =
base.buildInputs
++ [
pkgs.cabal-install
pkgs.postgresql
postgrest.hsie.bin
postgrest.treefmtNix.wrapper
]
++ toolboxes;
shellHook = ''
export HISTFILE=.history
# Bypass proxy for all hosts, it prevents HTTP client failures used in test
# suites. See: https://github.com/PostgREST/postgrest/issues/4633 for more info
export NO_PROXY=*
source ${pkgs.bash-completion}/etc/profile.d/bash_completion.sh
source ${pkgs.git}/share/git/contrib/completion/git-completion.bash
source ${postgrest.hsie.bash-completion}
# Activate current shell's additional .git configuration.
# Since there can only be a single such value, this will not cause a garbage
# collection problem - older references to the /nix/store will be cleaned up
# automatically when entering the nix-shell on a newer branch.
# Git ignores files it can't find, which means that once a file has been garbage
# collected, git will continue to work even without entering nix-shell.
git config --local include.path ${postgrest.gitTools.config}
''
+ builtins.concatStringsSep "\n" (
map (bash-completion: "source ${bash-completion}") (
builtins.concatLists (map (toolbox: toolbox.bash-completion) toolboxes)
)
);
})