-
Notifications
You must be signed in to change notification settings - Fork 4
/
configuration.nix
329 lines (276 loc) · 8.32 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
{
config,
pkgs,
lib,
inputs,
...
}:
{
# Allow opening a shell during boot.
# systemd.additionalUpstreamSystemUnits = ["debug-shell.service"];
time.timeZone = "Europe/Amsterdam";
suites.single-user.enable = true;
suites.sway.enable = true;
boot.initrd.systemd.enable = true;
boot.loader.systemd-boot.configurationLimit = 5;
boot.plymouth.enable = true;
boot.consoleLogLevel = 3;
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.kernelParams = [
"quiet"
"udev.log_priority=3"
];
boot.loader.timeout = 0;
programs.nix-ld.enable = true;
# 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;
};
# Smartcard daemon for Yubikey
services.pcscd.enable = true;
security.sudo.enable = true;
# On my desktop I don't want to run into file limitations.
# Using vite with a large project made Chromium reach the
# limit, resulting in weird behaviour without proper errors. Never again.
security.pam.loginLimits = [
{
domain = "*";
type = "soft";
item = "nofile";
value = "-1";
}
{
domain = "*";
type = "hard";
item = "nofile";
value = "-1";
}
];
hardware.bluetooth = {
enable = true;
# hsphfpd.enable = true;
settings = {
General = {
# To enable BlueZ Battery Provider
Experimental = true;
};
};
};
hardware.logitech.wireless = {
enable = true;
enableGraphical = true;
};
# Workaround: https://github.com/NixOS/nixpkgs/issues/114222
systemd.user.services.telephony_client.enable = false;
hardware.graphics.enable = true;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
pulse.enable = true;
alsa.enable = true;
alsa.support32Bit = true;
};
networking = {
hostName = "nac44250";
firewall.enable = true;
networkmanager = {
enable = true;
plugins = with pkgs; [ networkmanager-openvpn ];
};
};
services.resolved.enable = true;
programs.openvpn3.enable = true;
fonts = {
fontDir.enable = true;
fontconfig = {
enable = true;
defaultFonts = {
monospace = [ "SauceCodePro Nerd Font" ];
};
};
packages = with pkgs; [
(nerdfonts.override { fonts = [ "SourceCodePro" ]; })
corefonts # Microsoft free fonts
noto-fonts
noto-fonts-emoji
];
};
environment.systemPackages = with pkgs; [
bash
moreutils # sponge...
unzip
vim
wget
htop
efibootmgr
# Networking tools
inetutils # hostname ping ifconfig...
dnsutils # dig nslookup...
bridge-utils # brctl
iw
wirelesstools # iwconfig
docker
usbutils # lsusb
polkit_gnome
sbctl
];
# Use experimental nsncd. See https://flokli.de/posts/2022-11-18-nsncd/
services.nscd.enableNsncd = true;
services.acpid.enable = true;
security.polkit.enable = true;
services.upower = {
enable = true;
timeAction = 15 * 60;
percentageCritical = 10;
};
services.tlp.enable = true;
services.earlyoom.enable = true;
# Set permissions for RTL2832 USB dongle to use with urh.
hardware.rtl-sdr.enable = true;
services.udev.extraRules = ''
# Thunderbolt
# Always authorize thunderbolt connections when they are plugged in.
# This is to make sure the USB hub of Thunderbolt is working.
ACTION=="add", SUBSYSTEM=="thunderbolt", ATTR{authorized}=="0", ATTR{authorized}="1"
# Saleae Logic Analyzer
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="0925", ATTR{idProduct}=="3881", MODE="0666"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="21a9", ATTR{idProduct}=="1001", MODE="0666"
# Arduino
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="2341", ATTR{idProduct}=="0043", MODE="0666", SYMLINK+="arduino"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0664", GROUP="uucp"
SUBSYSTEM=="tty", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0043", MODE="0660", SYMLINK+="ttyArduinoUno"
SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", MODE="0660", SYMLINK+="ttyArduinoNano2"
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", MODE="0660", SYMLINK+="ttyArduinoNano"
# For OVR
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="2833", TAG+="uaccess"
# For OpenHMD
SUBSYSTEM=="usb", ATTRS{idVendor}=="2833", TAG+="uaccess"
'';
services.locate = {
enable = true;
pruneNames = [ ];
};
services.openssh.enable = false;
# No need for printing atm.
# services.printing = {
# enable = true;
# drivers = with pkgs; [ gutenprint splix cups-bjnp ];
# };
services.avahi = {
enable = true;
browseDomains = [ ];
# Seems to be causing trouble/slowness when resolving hosts
#nssmdns = true;
publish.enable = false;
};
services.redshift.enable = true;
location.provider = "geoclue2";
services.greetd = {
enable = true;
settings = {
default_session = {
command = "${lib.getExe pkgs.cage} ${lib.getExe pkgs.greetd.gtkgreet}";
};
initial_session = {
command = "${lib.getExe pkgs.sway}";
user = config.suites.single-user.user;
};
};
};
services.xserver.enable = false;
services.displayManager.autoLogin.enable = true;
# Fingerprint reader
services.fprintd.enable = true;
security.pam.services.login.fprintAuth = true;
security.pam.services.xscreensaver.fprintAuth = true;
services.gnome.gnome-keyring.enable = true;
programs.fish.enable = true;
programs.bash.completion.enable = true;
programs.tmux.enable = true;
programs.adb.enable = true;
programs._1password.enable = true;
programs._1password-gui = {
enable = true;
polkitPolicyOwners = [ config.suites.single-user.user ];
};
# virtualisation.virtualbox.host.enable = true;
virtualisation.docker = {
enable = true;
# daemon.settings = {
# ipv6 = true;
# "fixed-cidr-v6" = "fd00::/80";
# };
autoPrune.enable = true;
};
networking.firewall.trustedInterfaces = [ "docker0" ];
users.defaultUserShell = pkgs.fish;
nixpkgs.config.allowUnfree = true;
nixpkgs.config.permittedInsecurePackages = [ "electron-25.9.0" ];
documentation.enable = false;
documentation.nixos.enable = false;
# system.replaceRuntimeDependencies = [
# ({
# original = pkgs.xz;
# replacement = pkgs.xz.overrideAttrs (oldAttrs: {
# src = pkgs.fetchurl {
# url = "mirror://sourceforge/lzmautils/xz-5.4.6.tar.bz2";
# sha256 = "sha256-kThRsnTo4dMXgeyUnxwj6NvPDs9uc6JDbcIXad0+b0k=";
# };
# });
# })
# ];
nix = {
registry.nixpkgs.flake = inputs.nixpkgs;
gc = {
dates = "weekly";
automatic = true;
options = "--delete-older-than 60d";
};
settings = {
sandbox = true;
extra-sandbox-paths = [ "/etc/nix/netrc" ];
trusted-users = [
"root"
"${config.suites.single-user.user}"
];
substituters = [ "https://cachix.cachix.org" ];
extra-experimental-features = [
"nix-command"
"flakes"
"ca-derivations"
];
netrc-file = "/etc/nix/netrc";
auto-optimise-store = true;
log-lines = 100;
warn-dirty = false;
};
package = pkgs.nixVersions.git.overrideAttrs (oldAttrs: {
patches = [
(pkgs.fetchpatch {
url = "https://github.com/NixOS/nix/pull/11695.patch";
hash = "sha256-2cFZCDWvFPux9ogenGW7JNR50yxWsgX/v+LUqDS1aZk=";
})
];
});
};
system.autoUpgrade = {
enable = false;
flake = "/home/bob.vanderlinden/projects/bobvanderlinden/nixos-config";
flags = [
"--update-input"
"nixpkgs"
"--commit-lock-file"
];
dates = "17:30";
};
# 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 = "21.03"; # Did you read the comment?
}