-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevelopment.nix
209 lines (187 loc) · 5.15 KB
/
development.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
{ config, pkgs, lib, ... } @ args:
with lib;
with import ./prelude args;
let
customVimPlugins = pkgs.unstable.vimPlugins.extend (
pkgs.unstable.callPackage ./neovim/custom-plugins.nix {}
);
cudatk = pkgs.unstable.cudatoolkit;
nvidia = config.boot.kernelPackages.nvidia_x11;
in {
documentation = {
enable = true;
dev.enable = true;
man.generateCaches = true;
};
environment = {
systemPackages = unite [
(with pkgs; [
[true [
inotify-tools geoipWithDatabase
sshfs
# languages
black
llvmPackages_latest.llvm llvmPackages_latest.bintools llvmPackages_latest.lld
clang sccache
direnv
]]
[cfg.graphical [
ghidra sqlitebrowser
jetbrains.idea-community
jetbrains.pycharm-community
]]
[hasNv [
cudatk
nvidia
]]
])
(with unstable; [
[true [
difftastic mergiraf
websocat
typst
tinymist
typos-lsp
nil
]]
[cfg.graphical [
godot_4
neovide
]]
])
];
sessionVariables = {
VK_LOADER_DRIVERS = let
manifest = driver: is64bit: let
suffix = optionalString (!is64bit) "-32";
# TODO: figure out how to handle ARM and RISC-V archs
arch = if is64bit then "x86_64" else "i686";
in
"/run/opengl-driver${suffix}/share/vulkan/icd.d/${driver}_icd.${arch}.json";
in
concatMap
(driver: map (manifest driver) [true false])
# that var already took care of putting the preferred one first (if any)
allVideoDrivers;
NEOVIDE_FORK = "1";
}
// (if hasNv then {
# both required for blender
CUDA_PATH = "${cudatk}";
CYCLES_CUDA_EXTRA_CFLAGS = concatStringsSep " " [
"-I${cudatk}/targets/x86_64-linux/include"
"-I${nvidia}/lib"
];
} else {})
// (if cfg.wayland then {
NIXOS_OZONE_WL = "1";
WLR_NO_HARDWARE_CURSORS = "1";
} else {});
extraInit = (optionalString (hasNv && cfg.xorg) ''
export LD_LIBRARY_PATH="${config.hardware.nvidia.package}/lib:$LD_LIBRARY_PATH"
'')
+ (optionalString cfg.xorg ''
# is X even running yet?
if [[ -n $DISPLAY ]]; then
# key repeat delay + rate
xset r rate 260 60
# turn off the bell sound
xset b off
fi
'');
};
programs = {
neovim = {
defaultEditor = true;
package = pkgs.unstable.neovim-unwrapped;
withNodeJs = true;
withRuby = false;
configure = {
customRC = ''
silent! source ~/.config/nvim/init.vim
'';
packages.plugins = with customVimPlugins; {
start = [
multisn8-colorschemes
nvim-cmp cmp-path cmp-cmdline cmp-nvim-lsp
cmp-vsnip vim-vsnip
nvim-lspconfig trouble-nvim plenary-nvim
telescope-nvim telescope-ui-select-nvim
nvim-dap nvim-dap-ui
(nvim-treesitter.withPlugins (parsers: with parsers; [
arduino c cpp c_sharp elixir gdscript javascript julia haskell
ocaml objc lua python r rust swift typescript
glsl hlsl wgsl
cuda
bash
gitignore gitcommit git_rebase git_config gitattributes
vim nix proto godot_resource
kdl ini toml yaml json json5 xml
css html
sql dot mermaid
latex bibtex markdown typst
diff query vimdoc
agda
vhdl
]))
nvim-treesitter-context
nvim-ts-autotag
rainbow-delimiters-nvim
typst-preview-nvim
vim-polyglot vim-signify
];
opt = [];
};
};
};
git.lfs.enable = true;
};
fonts = mkIf cfg.graphical {
packages = with pkgs; [
hack-font
roboto roboto-mono
ibm-plex
manrope
source-code-pro
(nerdfonts.override { fonts = ["FiraCode" "JetBrainsMono"]; })
departure-mono
atkinson-hyperlegible
montserrat
noto-fonts
cantarell-fonts
inter
overpass
ttf_bitstream_vera
ubuntu_font_family
source-han-sans
libertinus
];
fontDir.enable = true;
# this adds a few commonly expected fonts like liberation...
enableDefaultPackages = true;
fontconfig = let
# in points
size = 14;
in {
hinting.style = "slight";
# ...while this one sets the actually in-place default fonts
defaultFonts = {
serif = ["Libertinus Serif"];
sansSerif = ["IBM Plex Sans"];
monospace = ["JetBrainsMono NL NF Light"];
};
# see fonts-conf(5), especially on the <EDIT ...> part
localConf = ''
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'urn:fontconfig:fonts.dtd'>
<fontconfig>
<match>
<edit name="size" binding="strong">
<double>${toString size}</double>
</edit>
</match>
</fontconfig>
'';
};
};
}