/
config.nix
264 lines (243 loc) · 5.49 KB
/
config.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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# symlink this file to ~/.nixpkgs/config.nix
{
allowUnfree = true;
packageOverrides = super: let self = super.pkgs; in with self; rec {
hello_world = stdenv.mkDerivation {
name = "hello_world";
src = ~/.dotfiles/src/hello_world;
buildInputs = [ libmikey ];
installPhase = ''
mkdir -p $out/bin
cp hello_world $out/bin/hello_world
'';
};
libmikey = callPackage ~/.dotfiles/nix/pkgs/libmikey {};
linuxOnly = buildEnv {
name = "linuxOnly";
paths = [
# c
clang
# other
bmon
coreutils
docker_compose
dotnet-sdk_5
mariadb-client
mdk
nodejs-14_x
omnisharp-roslyn
pinentry
unzip
vnstat
];
};
# After installing an app, with KDE, need to run:
#
# $ kbuildsycoca5
#
# to reindex for the apps menu.
linuxApps = buildEnv {
name = "linuxApps";
paths = [
firefox
slack
zoom-us
];
};
linuxEnv = buildEnv {
name = "linuxEnv";
paths = [
devEnv
linuxOnly
];
};
# An example nix package that builds GNU's `hello'. See the
# `example-pkg-hello' directory for how this is set up. Taken from
# the Nix manual:
# http://nixos.org/nix/manual/#chap-writing-nix-expressions
#
# to build, for instance:
# $ nix-build "<nixpkgs>" -A example-pkg-hello
example-pkg-hello = callPackage ~/.dotfiles/nix/pkgs/example-pkg-hello {};
scala = super.scala.override {
jre = jdk17;
};
sbt = super.sbt.override {
jre = jdk17;
};
# https://github.com/NixOS/nixpkgs/pull/296012/files
metals = super.metals.overrideAttrs (final: prev: {
version = "1.2.2";
deps = stdenv.mkDerivation {
name = "${prev.pname}-deps-1.2.2";
buildCommand = ''
export COURSIER_CACHE=$(pwd)
${super.pkgs.coursier}/bin/cs fetch org.scalameta:metals_2.13:1.2.2 \
-r bintray:scalacenter/releases \
-r sonatype:snapshots > deps
mkdir -p $out/share/java
cp $(< deps) $out/share/java/
'';
outputHashMode = "recursive";
outputHashAlgo = "sha256";
outputHash = "sha256-xk2ionn/lBV8AR7n7OR03UuRCoP1/K6KuohhpRwFock=";
};
buildInputs = [ final.deps ];
});
scala-cli = super.scala-cli.override {
jre = jdk17;
};
aspellEnv = aspellWithDicts(ps: [ ps.en ps.es ]);
# ----------------------
# Emacs & emacs packages
# ----------------------
myEmacs =
let
myEmacsBuild = super.emacs29;
myPackages = epkgs: (with epkgs; [
mu4e
]) ++ (with epkgs.elpaPackages; [
ace-window
cl-lib
eglot
modus-themes
org
rainbow-mode
]) ++ (with epkgs.melpaStablePackages; [
ag
apache-mode
avy
bm
cargo
counsel
counsel-projectile
dap-mode
diminish
dracula-theme
edit-indirect
editorconfig
elm-mode
ess
flycheck
geiser
go-mode
haml-mode
haskell-mode
ibuffer-vc
js2-mode
jtsx
markdown-mode
material-theme
multiple-cursors
org-mime
org-tree-slide
password-store
php-mode
posframe
prettier
projectile
protobuf-mode
racer
rjsx-mode
rust-mode
sbt-mode
scala-mode
swift-mode
terraform-mode
web-mode
winring
yafolding
yaml-mode
yard-mode
yasnippet
]) ++ (with epkgs.nongnuPackages; [
org-contrib
]) ++ (with epkgs.melpaPackages; [
color-theme-sanityinc-tomorrow
company
company-box
company-racer
flycheck-rust
forge
gptel
inf-ruby
ivy-pass
jq-mode
ledger-mode
magit
nix-mode
orgit
ox-reveal
proof-general
purescript-mode
restclient
restclient-jq
ruby-test-mode
]);
in (pkgs.emacsPackagesFor myEmacsBuild).emacsWithPackages myPackages;
myREnv = super.rWrapper.override {
packages = with self.rPackages; [
ggplot2
lubridate
plyr
];
};
# ---------------------
# Developer environment
# ---------------------
#
# To install all at once:
# $ nix-env -iA nixpkgs.devEnv
devEnv = buildEnv {
name = "devEnv";
paths = [
libmikey
# useful tools
aspellEnv
cloc
cmake
ctags
git
graphviz
hledger
hledger-web
htop
imagemagick
jq
ledger
libxml2
lynx
mu
myEmacs
myREnv
nasm
ngrok
niv
nix-prefetch-git
offlineimap
parallel
pass
protobuf
ripgrep
silver-searcher
tmux
tree
watch
wget
# scala
jdk17
metals
sbt
scala
scala-cli
];
};
myPython3Env = python3.withPackages (p: with p; [
virtualenv
pip
numpy
boto3
matplotlib
]);
};
}