-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfiguration.nix
339 lines (295 loc) · 8.64 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
# 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’).
{ config, pkgs, ... }:
{
require = [
./crate.nix
../scripts.nix
../packages.nix
../unstable.nix
../local.nix
];
imports =
[ # Include the results of the hardware scan.
<nixos-hardware/lenovo/thinkpad/t480s>
./hardware-configuration.nix
];
nixpkgs.config.allowUnfree = true;
nix = {
autoOptimiseStore = true;
allowedUsers = [ "@wheel" ];
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
};
# Use the systemd-boot EFI boot loader.
boot = rec {
kernelPackages = pkgs.linuxPackages_5_10;
extraModulePackages = [kernelPackages.v4l2loopback];
zfs.requestEncryptionCredentials = true;
kernelParams = ["acpi_backlight=native" "elevator=none"]; #https://grahamc.com/blog/nixos-on-zfs
kernelModules = ["v4l2loopback" "kvm-intel"];
loader = {
# Use the systemd-boot EFI boot loader.
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
grub.copyKernels = true;
};
supportedFilesystems = ["zfs"];
};
# Set your time zone.
time.timeZone = "America/New_York";
networking = {
hostName = "simpson-nixos"; # Define your hostname.
firewall.enable = true;
wireless.iwd.enable = true;
hostId = "ed6bb572"; # head -c4 /dev/urandom | od -A none -t x4
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
# Per-interface useDHCP will be mandatory in the future, so this generated config
# replicates the default behaviour.
useDHCP = false;
interfaces.enp0s31f6 = {
useDHCP = true;
wakeOnLan = {
enable = true;
};
};
extraHosts =
''
127.0.0.1 sparkbox.local
'';
networkmanager = {
enable = true;
wifi.powersave = true;
wifi.backend = "iwd";
};
iproute2.enable = true;
useHostResolvConf = false;
};
fonts = {
enableDefaultFonts = true;
# Give fonts to 32-bit binaries too (e.g. steam).
fontconfig.cache32Bit = true;
fonts = with pkgs; [
hack-font google-fonts liberation_ttf opensans-ttf roboto roboto-mono
];
};
sound.enable = true;
# Enable touchpad support (enabled default in most desktopManager).
#services.xserver.libinput.enable = true;
users.users.adam = {
isNormalUser = true;
extraGroups = [ "bluetooth" "docker" "wheel" "lp" "video" "audio" "libvirtd" ];
shell = pkgs.zsh;
};
security.polkit.enable = true;
programs.dconf.enable = true;
programs.zsh.enable = true;
programs.ssh.startAgent = true;
programs.light.enable = true;
hardware = {
enableRedistributableFirmware = true;
trackpoint.enable = true;
opengl = {
enable = true;
#extraPackages = with pkgs; [
# intel-
#];
};
logitech.wireless.enable = true;
# install via nix-env for pactl
pulseaudio.enable = false;
bluetooth.enable = true;
i2c.enable = true;
cpu.intel.updateMicrocode = true;
};
documentation.dev.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;
};
programs.sway = {
enable = false;
wrapperFeatures.gtk = true; # so that gtk works properly
extraPackages = with pkgs; [
swaylock
swayidle
wl-clipboard
mako # notification daemon
alacritty # Alacritty is the default terminal in the config
dmenu # Dmenu is the default in the config but i recommend wofi since its wayland native
xwayland
];
extraSessionCommands = ''
export MOZ_ENABLE_WAYLAND=1
export XDG_CURRENT_DESKTOP=sway
'';
};
systemd.network = {
networks."40-enp0s31f6" = {
networkConfig = {
MulticastDNS = true;
};
};
};
#environment.loginShellInit = ''
# if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then
# exec sway
# fi
#'';
# List services that you want to enable:
services = {
lorri.enable = true;
syncthing = {
enable = true;
user = "adam";
dataDir = "/home/adam/Sync";
configDir = "/home/adam/.config/syncthing";
devices = {
wemm = {
id = "A7BKRRY-5AIRT4B-YP4DXYX-RL7SKZ5-52TKEY2-NNJGBZ6-YF423ON-TCW7MQM";
};
ged = {
id = "GNI7GNS-BYK6EPE-4J7PJNF-D3EQ7DS-5OHVKF2-3RIB3UD-V6AYEK7-XLVKFQ5";
};
};
folders = {
"/home/adam/notes" = {
id = "qjwus-uru7t";
devices = [ "wemm" "ged" ];
label = "notes";
};
};
};
resolved = {
enable = true;
dnssec = "false";
extraConfig = "MulticastDNS=true";
};
mpdscribble = {
enable = true;
endpoints = {
"last.fm" = {
username = "skimpson";
passwordFile = "/home/adam/lastfm-pass";
};
};
};
tailscale.enable = true;
gnome.sushi.enable = true;
printing = {
enable = true;
drivers = [ pkgs.brlaser ];
};
#avahi.enable = true;
openssh.enable = true;
blueman.enable = true;
gnome.gnome-keyring.enable = true;
zfs = {
autoSnapshot.enable = true;
autoScrub.enable = true;
};
timesyncd = {
enable = true;
servers = ["time.google.com"];
};
xserver = {
layout = "us";
enable = true;
libinput.enable = true;
desktopManager = {
xterm.enable = false;
};
displayManager = {
defaultSession = "none+i3";
};
windowManager.i3 = {
enable = true;
extraPackages = with pkgs; [
rofi #application launcher most people use
i3status # gives you the default i3 status bar
];
};
};
tlp.enable = true;
acpid.enable = true;
colord.enable = true;
fprintd.enable = false;
fwupd.enable = true;
cron.enable = true;
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
config.pipewire = {
"api.alsa.ignore-dB" = true;
};
};
udev = {
extraRules = ''
ACTION!="add|change", GOTO="end_disable_infared"
ATTRS{idVendor}=="04f2", ATTRS{idProduct}=="b615", ATTR{bConfigurationValue}="0"
LABEL="end_disable_infared"
LABEL="gmk pro regular user access"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", TAG+="uaccess"
SUBSYSTEM=="drm", ACTION=="change", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/adam/.Xauthority", RUN+="${pkgs.bash}/bin/bash /home/adam/.dotfiles/linux/i3-monitor-change.sh"
'';
};
};
virtualisation = {
libvirtd.enable = true;
libvirtd.qemu = {
package = pkgs.qemu_kvm;
runAsRoot = true;
swtpm.enable = true;
ovmf = {
enable = true;
package = (pkgs.OVMFFull.override {
secureBoot = true;
tpmSupport = true;
});
};
};
docker = {
enable = true;
autoPrune.enable = true;
};
};
security.pam = {
u2f.enable = true;
u2f.cue = true;
u2f.authFile = "/home/adam/.config/Yubico/u2f_keys";
services = {
login.u2fAuth = true;
login.fprintAuth = false;
lightdm.u2fAuth = true;
sudo.u2fAuth = true;
sudo.fprintAuth = false;
lightdm.enableGnomeKeyring = true;
login.enableGnomeKeyring = true;
};
};
nixpkgs.overlays = [
(import (builtins.fetchTarball {
url = https://github.com/nix-community/emacs-overlay/archive/master.tar.gz;
}))
];
#polkit-gnome doesn't show up in the normal /usr location so I symlink it out of the store to /etc/polkit-gnome-authentication-agent-1
environment.etc."polkit-gnome-authentication-agent-1".source = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
system.autoUpgrade.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 = "21.05"; # Did you read the comment?
}