-
Notifications
You must be signed in to change notification settings - Fork 0
/
configuration.nix
370 lines (316 loc) · 8.54 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
{
inputs,
config,
pkgs,
...
}: {
nixpkgs.config.allowUnfree = true;
nix = {
settings = {
experimental-features = ["nix-command" "flakes"];
auto-optimise-store = true;
substituters = ["https://hyprland.cachix.org"];
trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="];
};
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 14d";
};
};
programs.nh = {
enable = true;
#clean.enable = true;
#clean.extraArgs = "--keep-since 7d --keep 3";
flake = "/home/luis/.dotnix";
};
programs.command-not-found.enable = false;
programs.nix-index = {
enable = true;
enableFishIntegration = true;
};
programs.nix-ld.enable = true;
programs.nix-ld.libraries = with pkgs; [
stdenv.cc.cc.lib
zlib
];
boot = {
kernelParams = ["quiet"];
kernelPackages = pkgs.linuxPackages_latest;
kernelModules = ["thinkpad_acpi"];
extraModulePackages = with config.boot.kernelPackages; [
v4l2loopback
];
initrd = {
systemd.enable = true;
secrets = {
"/crypto_keyfile.bin" = null;
};
};
loader = {
systemd-boot = {
enable = true;
configurationLimit = 50;
};
efi.canTouchEfiVariables = true;
efi.efiSysMountPoint = "/boot/efi";
};
};
services.greetd = {
enable = true;
settings = {
default_session = {
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --asterisks --remember --remember-session --sessions ${inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland}/share/wayland-sessions";
user = "greeter";
};
};
};
systemd.services.greetd.serviceConfig = {
Type = "idle";
StandardInput = "tty";
StandardOutput = "tty";
StandardError = "journal";
TTYReset = true;
TTYVHangup = true;
TTYVTDisallocate = true;
};
hardware.enableAllFirmware = true;
hardware.firmware = with pkgs; [wireless-regdb];
time.timeZone = "Europe/Zurich";
i18n.defaultLocale = "en_US.UTF-8";
networking = {
hostName = "lwirth-tp";
networkmanager.enable = true;
};
security.sudo.wheelNeedsPassword = false;
users.groups.stdgroup = {
name = "standard";
members = ["luis" "guest"];
};
users.users.luis = {
description = "Luis Wirth";
isNormalUser = true;
extraGroups = ["wheel" "input" "video" "audio" "networkmanager" "libvirtd" "docker" "usbmux"];
};
users.users.guest = {
description = "Guest";
isNormalUser = true;
extraGroups = [];
};
programs.fish.enable = true;
users.defaultUserShell = pkgs.fish;
environment.pathsToLink = ["/share/fish"];
environment.shells = with pkgs; [fish];
# caps as escape in tty
services.xserver.xkb.options = "caps:escape";
console.useXkbConfig = true;
services.fwupd.enable = true;
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
settings = {
General = {
ControllerMode = "bredr";
};
};
};
hardware.logitech.wireless.enable = true;
services.printing.enable = true;
services.fprintd = {
enable = true;
package = pkgs.fprintd-tod;
tod = {
enable = true;
driver = pkgs.libfprint-2-tod1-vfs0090;
};
};
nixpkgs.config.packageOverrides = pkgs: {
vaapiIntel = pkgs.vaapiIntel.override {enableHybridCodec = true;};
};
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
amdvlk
intel-media-driver
vaapiIntel
vaapiVdpau
libvdpau-va-gl
];
};
services.logind = {
lidSwitch = "suspend";
lidSwitchExternalPower = "suspend";
lidSwitchDocked = "ignore";
};
# power saving
powerManagement.enable = true;
services.thermald.enable = true;
services.tlp.enable = true;
services.upower = {
enable = true;
criticalPowerAction = "Hibernate";
};
services.thinkfan = {
enable = true;
levels = [
[0 0 55]
[1 48 60]
[2 50 61]
[3 52 63]
[6 56 65]
[7 60 95]
["level full-speed" 90 32767]
];
};
programs.light.enable = true;
# virtualization
virtualisation.libvirtd.enable = true;
programs.virt-manager.enable = true;
virtualisation.docker.enable = true;
documentation.dev.enable = true;
services.avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
programs.mtr.enable = true;
services.pcscd.enable = true;
services.gvfs.enable = true;
services.openssh = {
enable = true;
ports = [22];
settings = {
PermitRootLogin = "no";
KbdInteractiveAuthentication = false;
PasswordAuthentication = false;
};
#extraConfig = "AuthenticationMethods \"publickey,password\"";
};
services.fail2ban = {
enable = true;
maxretry = 5;
bantime = "1h";
bantime-increment.enable = true;
};
services.dbus.packages = with pkgs; [
gcr
swaynotificationcenter
];
networking.firewall = {
enable = true;
allowPing = true;
allowedTCPPorts = [22 42069];
};
security.pam.services.hyprlock = {};
programs.droidcam.enable = true;
services.usbmuxd = {
enable = true;
package = pkgs.usbmuxd2;
};
security.rtkit.enable = true;
security.polkit.enable = true;
# kmsgrab without sudo
security.wrappers = {
ffmpeg = {
owner = "root";
group = "root";
capabilities = "cap_sys_admin=ep";
source = "${pkgs.ffmpeg}/bin/ffmpeg";
};
};
systemd.packages = with pkgs; [swaynotificationcenter];
systemd.services.lock-on-sleep = {
description = "Lock on sleep";
before = ["sleep.target"];
wantedBy = ["sleep.target"];
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.systemd}/bin/loginctl lock-sessions";
};
};
systemd.user.services.polkit-kde-authentication-agent-1 = {
description = "polkit-kde-authentication-agent-1";
wants = ["graphical-session.target"];
wantedBy = ["graphical-session.target"];
after = ["graphical-session.target"];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
#jack.enable = true;
};
services.xserver.videoDrivers = ["amdgpu"];
programs.hyprland = {
enable = true;
xwayland.enable = true;
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
portalPackage = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland;
};
stylix = {
enable = true;
image = "${pkgs.hyprland}/share/hypr/wall0.png";
polarity = "dark";
base16Scheme = "${pkgs.base16-schemes}/share/themes/da-one-ocean.yaml";
cursor = {
size = 24;
package = pkgs.apple-cursor;
name = "macOS-Monterey";
};
fonts = {
sizes = {
applications = 10;
terminal = 14;
desktop = 10;
popups = 10;
};
monospace = {
package = pkgs.nerdfonts.override {fonts = ["FiraCode"];};
name = "FiraCode Nerd Font Mono";
};
sansSerif = {
package = pkgs.dejavu_fonts;
name = "DejaVu Sans";
};
serif = {
package = pkgs.dejavu_fonts;
name = "DejaVu Serif";
};
};
targets.gnome.enable = true;
};
services.udev.extraRules = ''
# rp2040
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2e8a", MODE:="0666"
# picoprobe
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="0004", MODE="0666"
'';
environment.systemPackages = with pkgs; [
virtiofsd
libimobiledevice
ifuse
man-pages
man-pages-posix
];
programs.steam = {
enable = true;
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
gamescopeSession.enable = true;
};
# 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 = "22.11"; # Did you read the comment?
}