-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
43 lines (38 loc) · 955 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
let nixpkgs = <nixpkgs>;
config = {};
in with import nixpkgs { inherit config; }; let
shellWrapper = writeScript "shell-wrapper" ''
#! ${stdenv.shell}
set -e
exec -a shell ${fish}/bin/fish --login --interactive --init-command='
set -x root '"$root"'
set config $root/.fish.conf
set personal_config $root/.personal.fish.conf
if test -e $personal_config
source $personal_config
end
if test -e $config
source $config
end
' "$@"
'';
in stdenv.mkDerivation rec {
name = "nix-shell";
buildInputs = [
glibcLocales bashInteractive man
nix cacert curl utillinux coreutils
git jq tmux findutils gnumake
go gopls
];
shellHook = ''
export root=$(pwd)
if [ -f "$root/.env" ]
then
source "$root/.env"
fi
export LANG="en_US.UTF-8"
export SHELL="${shellWrapper}"
export NIX_PATH="nixpkgs=${nixpkgs}"
exec "$SHELL"
'';
}