-
Notifications
You must be signed in to change notification settings - Fork 3
/
dev-env.nix
192 lines (187 loc) · 5.42 KB
/
dev-env.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
with import <nixpkgs> { };
# For testing local nixpkgs clone, swap with above
# with import ((builtins.getEnv "HOME") + "/workspace/nixpkgs") { }; # or:
# with import "../nixpkgs" { };
# Note taht the above are not accessible during docker build
let
ideaLocal = stdenv.mkDerivation {
name = "idea-local";
buildInputs = [ ];
builder = builtins.toFile "builder.sh" ''
source $stdenv/setup
mkdir -p $out/bin
tar zxvf $src -C $out/
ln -sf $out/idea-IU* $out/idea
ln -sf $out/idea/bin/idea.sh $out/bin/idea
'';
# Note shellHooks is not used by nix-env
shellHook = ''
IDEA_JDK=/usr/lib/jvm/zulu-8-amd64
'';
src = fetchurl {
url = https://download.jetbrains.com/idea/ideaIU-2017.2.5-no-jdk.tar.gz;
sha256 = "6649ec545093be46ebf2bf2d76e4b67597b2c92ea9ad80fe354db130994de45e";
};
};
dottyLocal = stdenv.mkDerivation {
name = "dotty-local";
buildInputs = [ ];
builder = builtins.toFile "builder.sh" ''
source $stdenv/setup
mkdir -p $out/bin
tar zxvf $src -C $out/
ln -sf $out/dotty-* $out/dotty
ln -sf $out/dotty/bin/* $out/bin/
'';
src = fetchurl {
url = https://github.com/lampepfl/dotty/releases/download/0.3.0-RC2/dotty-0.3.0-RC2.tar.gz;
sha256 = "1359843e19ac25b1dc465bfb61d84aeb507476bca57a46d90a111454e123ab29";
};
};
ncursesLocal = stdenv.mkDerivation {
name = "ncurses-local";
buildInputs = [ncurses];
builder = builtins.toFile "builder.sh" ''
source $stdenv/setup
mkdir -p $out
'';
src = null;
installPhase = ''
# Hack around lack of libtinfo in NixOS
ln -s ${ncurses.out}/lib/libncursesw.so.5 $out/lib/libtinfo.so.5
ln -s ${stdenv.cc.libc}/lib/libpthread.so.0 $out/lib/libpthread.so.0
'';
};
herokuLocal = stdenv.mkDerivation {
name = "heroku-local";
buildInputs = [ ];
builder = builtins.toFile "builder.sh" ''
source $stdenv/setup
mkdir -p $out/bin
tar zxvf $src -C $out/
ln -sf $out/heroku-* $out/heroku
ln -sf $out/heroku/bin/* $out/bin/
'';
src = fetchurl {
url = https://cli-assets.heroku.com/heroku-cli/channels/stable/heroku-cli-linux-x64.tar.gz;
sha256 = "d6b8217ce15f3ba61a1872b8b95f353fdde1f03f885a0eb99141e45ae7426516";
};
};
in { brandonDevEnv = buildEnv {
name = "brandon-dev-env";
paths = [
ammonite
awscli
# bash-completion # disabled, using system bash
boehmgc
clang
curl
docker
docker_compose
# dotty # (Tentative Scala 3 compiler; see dottyLocal above for alternative)
dbus # needed non-explicitly by vscode
emacs
es
gdb
git
git-lfs
# git-secrets
gnumake
gnupg
gradle
# herokuLocal # no stable versioning/checksum
# idea.idea-ultimate # disabled temporarily due to runtime issues
# idris # currently has trouble building
# ideaLocal
less
libunwind
maven
mlton
# nix # could cause conflicts
ncursesLocal
nodejs-10_x
openjdk
openssh
phantomjs2
re2
ripgrep
rsync
sbt
scala
scalafmt
shellcheck
singularity
stdenv
syncthing # for syncrhonizing data between containers
tmux
tree
unzip
# visualvm # character issues currently, likely needs idea-jdk
# vscode # we no longer install vscode by default due to how WSL2 provides Windows code,
# though we note it can it could always be used via `nix-shell -p vscode` if desired
which
yarn
zlib
#
# For spacemacs
#
source-code-pro
#
#Haskell/Eta support
#
ghc # use stack instead, once working
cabal-install
direnv # for nix-shell/emacs integration
stack # The Haskell tool stack
# haskellPackages.ghc-mod # currently broken due to broken cabal-helper
# haskellPackages.codex # works with hasktags; currently broken
haskellPackages.hasktags
haskellPackages.hoogle
# haskellPackages.hoogle-index # currently broken due to missing deps
haskellPackages.hpack
haskellPackages.hlint
# haskellPackages.intero # fails, but works with cabal install ...
haskellPackages.stylish-haskell
#
# Python support
#
# Disabling the following until pipenv works
# python36Full
# python36Packages.virtualenv
# python36Packages.pip
# python36Packages.ipython
# nixpip # installed seperately: https://github.com/badi/nix-pip
mypy
#
# Rust support
#
rustup
# cargo # collides with rustup here, but can be installed via rustup
];
# builder = builtins.toFile "builder.sh" ''
# source $stdenv/setup
# mkdir -p $out
# echo "" > $out/Done
# echo "Done setting up Scala environment."
# '';
buildInputs = [ makeWrapper ];
# TODO: better filter, use ammonite script?:
postBuild = ''
# we remove a dead symbolic link, which currently causes nix to break:
# if [ ! -e $out/lib/libunwind-generic.a ] ; then
# rm $out/lib/libunwind-generic.a
# fi
# for f in $(ls -d $out/bin/* | grep "idea"); do
# sed -i '/IDEA_JDK/d' $f
# wrapProgram $f \
# --set IDEA_JDK "/usr/lib/jvm/zulu-8-amd64" \
# --set CLANG_PATH "${clang}/bin/clang" \
# --set CLANCPP_PATH "${clang}/bin/clang++"
# done
'';
};}
#######################################
#
# Refs:
# https://stackoverflow.com/questions/46165918/how-to-get-the-name-from-a-nixpkgs-derivation-in-a-nix-expression-to-be-used-by/46173041#46173041
##