-
Notifications
You must be signed in to change notification settings - Fork 0
/
configuration.nix
453 lines (404 loc) · 10.8 KB
/
configuration.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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{
pkgs,
inputs,
config,
lib,
...
}: {
imports = [
# Untouched hardware configuration file
./hardware-configuration.nix
];
# BOOTLOADER
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelModules = [
"i2c-dev"
"i2c-piix4"
# Virtual Camera. Custom DroidCam v4l2loopback driver needed for video.
"v4l2loopback"
# Virtual Microphone. Custom DroidCam v4l2loopback driver needed for audio.
"snd-aloop"
];
boot.extraModulePackages = [
pkgs.linuxPackages.v4l2loopback # Webcam loopback
];
# HOSTNAME
networking.hostName = "aliyss-bequitta";
# NETWORKING
networking.networkmanager.enable = true;
networking.firewall = {
enable = true;
allowedTCPPorts = [80 443 25565];
};
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# NETWORKING PROXY
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# TIMEZONE
time.timeZone = "Europe/Zurich";
# INTERNATIONALISATION PROPERTIES
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "de_CH.UTF-8";
LC_IDENTIFICATION = "de_CH.UTF-8";
LC_MEASUREMENT = "de_CH.UTF-8";
LC_MONETARY = "de_CH.UTF-8";
LC_NAME = "de_CH.UTF-8";
LC_NUMERIC = "de_CH.UTF-8";
LC_PAPER = "de_CH.UTF-8";
LC_TELEPHONE = "de_CH.UTF-8";
LC_TIME = "de_CH.UTF-8";
};
# SOUND
# sound.enable = true;
# SERVICES
services = {
# Sound
pipewire = {
enable = true;
alsa = {
enable = true;
support32Bit = true;
};
pulse.enable = true;
wireplumber = {
enable = true;
configPackages = [
(pkgs.writeTextDir "share/wireplumber/bluetooth.lua.d/51-bluez-config.lua" ''
bluez_monitor.properties = {
["bluez5.enable-sbc-xq"] = true,
["bluez5.enable-msbc"] = true,
["bluez5.enable-hw-volume"] = true,
["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]"
}
'')
];
};
};
# Bluetooth
blueman.enable = true;
# Display
xserver = {
enable = true;
videoDrivers = ["nvidia"];
displayManager.gdm = {
enable = false;
wayland = true;
};
# Keymaps
xkb = {
variant = "colemak_dh_iso";
layout = "us";
};
};
greetd = {
enable = true;
settings = {
default_session = {
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --time-format '%I:%M %p | %a • %h | %F' --cmd Hyprland";
# command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --time-format '%I:%M %p | %a • %h | %F' --cmd Hyprland";
# command = "${config.programs.hyprland.package}/bin/Hyprland";
user = "greeter";
};
};
};
# USB
devmon.enable = true;
gvfs.enable = true;
udisks2.enable = true;
# hardware.openrgb = {
# enable = true;
# package = pkgs.openrgb-with-all-plugins;
# };
};
systemd.services.greetd.serviceConfig = {
Type = "idle";
StandardInput = "tty";
StandardOutput = "tty";
StandardError = "journal"; # Without this errors will spam on screen
# Without these bootlogs will spam on screen
TTYReset = true;
TTYVHangup = true;
TTYVTDisallocate = true;
};
console = {
useXkbConfig = true;
};
security.pam.services.hyprlock = {
# text = "auth include system-auth";
text = "auth include login";
fprintAuth = false;
enableGnomeKeyring = true;
};
virtualisation.docker = {
enable = true;
enableOnBoot = false;
rootless = {
enable = true;
setSocketVariable = true;
daemon.settings = {
runtimes = {
nvidia = {
path = "${pkgs.nvidia-docker}/bin/nvidia-container-runtime";
};
};
};
};
daemon.settings = {
userns-remap = "default";
};
};
# DEFAULT USER ACCOUNT
# Define a user account. Don't forget to set a password with ‘passwd’.
users.users.aliyss = {
isNormalUser = true;
description = "aliyss";
extraGroups = ["networkmanager" "wheel" "docker" "uinput"];
};
# NIXPKGS CONFIG
nixpkgs.config.allowUnfree = true;
nixpkgs.config.cudaSupport = true;
# nixpkgs.config.pulseaudio = true;
# SYSTEM PROFILE PACKAGES
# $ nix search wget
environment.systemPackages = with pkgs; [
# Lock
greetd.tuigreet
# Terminal
foot
# Editor
## Vim: for quick configurations in case graphics dies
neovim
## Emacs: for everything else
((emacsPackagesFor emacs29-pgtk).emacsWithPackages
(epkgs: [epkgs.vterm epkgs.lsp-tailwindcss epkgs.dap-mode]))
### Emacs: Additional Packages, compatibility with config.org file
# youtube-dl
#### required to install some language servers
unzip
gcc
mpv
# Language Support
## PHP
php
### Globally installed PHP Packages
phpPackages.composer
## NodeJS
nodejs_20
### Globally installed Node Packages
nodePackages.typescript
nodePackages.typescript-language-server
nodePackages.eslint
nodePackages.eslint_d
nodePackages.jsonlint
nodePackages.tailwindcss
nodePackages.vercel
nodePackages."@tailwindcss/language-server"
nodePackages.prettier
nodePackages.localtunnel
## TailwindCSS
tailwindcss
## Typescript
typescript
## Rust
rustywind
rustc
cargo
rustfmt
rust-analyzer
clippy
openssl
pkg-config
gcc
## Flutter
flutter
## Python
python311
(python311.withPackages (ps:
with ps; [
pip
# python-openstackclient
]))
## Configuration Files
nil
## Nix
nixfmt-classic
# Hardware
pavucontrol
# Browser
firefox-wayland
# Theme
## Wallpaper for Hyprland
swww
## Cursor
hyprcursor
# Screenshots
grim
slurp
# Git
git
## Github CLI for git
gh
# Other Useful Packages
wget
wl-clipboard
ydotool
gsettings-desktop-schemas
xdg-user-dirs
# Gaming
## Minecraft Editor
mcaselector
## wine-staging (version with experimental features)
wineWowPackages.staging
## winetricks (all versions)
winetricks
## native wayland support (unstable)
wineWowPackages.waylandFull
(lutris.override {
extraPkgs = pkgs: [
# List package dependencies here
];
})
# Camera (DroidCam)
v4l-utils
android-tools
adb-sync
scrcpy
];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# NIX_LD
programs.nix-ld.enable = true;
# HYPRLAND
programs.hyprland = {
enable = true;
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
};
xdg.portal = {
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-gtk
xdg-desktop-portal-wlr
];
};
# SHELL CONFIGURATION
## ssh
programs.ssh.askPassword = "";
## zsh
programs.fish = {
enable = true;
shellAliases = {
ll = "ls -l";
screenshot = ''grim -g "$(slurp -d)"'';
};
};
## Default Shell
users.defaultUserShell = pkgs.fish;
## Environment Shell
environment.shells = with pkgs; [fish];
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It‘s perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.05"; # Did you read the comment?
# HARDWARE
hardware = {
# Display
mwProCapture.enable = true;
graphics = {
enable = true;
enable32Bit = true;
extraPackages = [pkgs.libvdpau-va-gl];
};
nvidia = {
modesetting.enable = true;
nvidiaSettings = true;
};
# Sound
pulseaudio.enable = false;
pulseaudio.support32Bit = true;
# Bluetooth
bluetooth.enable = true;
};
# FONTS
fonts.packages = with pkgs; [
(nerdfonts.override {fonts = ["JetBrainsMono"];})
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
liberation_ttf
fira-code
fira-code-symbols
mplus-outline-fonts.githubRelease
dina-font
proggyfonts
];
# environment.loginShellInit = ''
# if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then
# exec dbus-launch Hyprland
# fi
# '';
environment.variables = {
XDG_CURRENT_DESKTOP = "Hyprland";
XDG_SESSION_TYPE = "wayland";
XDG_SESSION_DESKTOP = "Hyprland";
YDOTOOL_SOCKET = "/tmp/ydotools";
RUST_BACKTRACE = "1";
LSP_USE_PLISTS = "true";
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
GSETTINGS_SCHEMA_DIR = "${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}/glib-2.0/schemas/";
WINEPREFIX = "~/.wine";
VDPAU_DRIVER = "va_gl";
LIBVA_DRIVER_NAME = "nvidia";
};
environment.sessionVariables = {
NIXOS_OZONE_WL = "1";
# GBM_BACKEND = "nvidia-drm";
};
environment.etc = let
mkEglFile = n: library: let
suffix = lib.optionalString (library != "wayland") ".1";
pkg =
if library != "wayland"
then config.hardware.nvidia.package
else pkgs.egl-wayland;
fileName = "${toString n}_nvidia_${library}.json";
library_path = "${pkg}/lib/libnvidia-egl-${library}.so${suffix}";
in {
"egl/egl_external_platform.d/${fileName}".source = pkgs.writeText fileName (builtins.toJSON {
file_format_version = "1.0.0";
ICD = {inherit library_path;};
});
};
in
{"egl/egl_external_platform.d".enable = false;}
// mkEglFile 10 "wayland"
// mkEglFile 15 "gbm"
// mkEglFile 20 "xcb"
// mkEglFile 20 "xlib";
# FLAKE
nix = {
settings.experimental-features = ["nix-command" "flakes"];
registry.nixpkgs.flake = inputs.nixpkgs;
nixPath = ["nixpkgs=${inputs.nixpkgs}"];
};
}