-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfiguration.nix
More file actions
226 lines (199 loc) · 4.83 KB
/
configuration.nix
File metadata and controls
226 lines (199 loc) · 4.83 KB
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
{ config, pkgs, ... }:
let
credentials = import ./credentials.nix;
in
{
imports =
[
./udev.nix
./users
./docker.nix
./lxd.nix
# Features
./features/mopidy.nix
./features/yubikey.nix
./features/vt420.nix
./features/wf-recorder.nix
./features/steam.nix
./fonts.nix
./scripts.nix
];
# Allow emulating aarch64-linux builds with qemu
boot.binfmt.emulatedSystems = [ "armv7l-linux" "aarch64-linux" ];
boot.binfmt.registrations.armv7l = {
interpreter = "${pkgs.qemu_full}/bin/qemu-system-arm";
magicOrExtension = ''\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00'';
mask = ''\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\x00\xff\xfe\xff\xff\xff'';
};
# Set time zone to pacific
time.timeZone = "US/Pacific";
# This allows us to dual boot windows without clock issues
time.hardwareClockInLocalTime = true;
environment.systemPackages = with pkgs; [
git
gnumake
curl
gnupg
man-pages
];
programs.dconf.enable = true;
programs.light.enable = true;
# Hardware defaults
hardware = {
bluetooth.enable = true;
pulseaudio = {
enable = true;
support32Bit = true;
daemon.config = {
default-sample-rate = 48000;
alternate-sample-rate = 44410;
avoid-resampling = true;
};
package = pkgs.pulseaudioFull;
};
opengl = {
enable = true;
driSupport32Bit = true;
extraPackages = with pkgs; [
mesa_drivers
libGL
intel-media-driver
vaapiIntel
vaapiVdpau
libvdpau-va-gl
];
setLdLibraryPath = true;
};
};
# Enable network manager
networking = {
usePredictableInterfaceNames = false;
wireless = {
enable = true;
interfaces = [ "wlan0" ];
networks = credentials.wifiNetworks;
userControlled.enable = true;
};
firewall = {
enable = false;
allowPing = true;
allowedTCPPorts = [ 56207 ];
allowedUDPPorts = [ 5353 56207 ];
};
nameservers = [ "1.1.1.1" "1.0.0.1" ];
# Don't take nameservers from DHCP
dhcpcd.extraConfig = ''
nooption domain_name_servers, domain_name, domain_search, host_name, ntp_servers
'';
};
boot.supportedFilesystems = [ "ntfs" ];
#
# Services:
#
services = {
# xserver = {
# enable = true;
# autorun = false;
# desktopManager.xterm.enable = false;
# displayManager = {
# lightdm.enable = true;
# #defaultSession = "sway";
# };
# windowManager.i3.enable = true;
# synaptics = {
# enable = true;
# vertTwoFingerScroll = true;
# vertEdgeScroll = false;
# palmDetect = true;
# };
# videoDrivers = [ "nvidia" ];
# screenSection = ''
# Option "metamodes" "HDMI-0: 1920x1080_144 +0+0 {ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}"
# '';
# };
# Battery/power utils
tlp.enable = true;
acpid.enable = true;
pcscd.enable = true;
upower = {
enable = true;
criticalPowerAction = "Hibernate";
};
# Enable CUPS
printing = {
enable = true;
drivers = with pkgs; [ gutenprint hplipWithPlugin ];
};
# Bluetooooth
blueman.enable = true;
# Enable geoclue location service
geoclue2.enable = true;
# Avahi for mDNS
avahi = {
enable = true;
nssmdns = true;
publish = {
enable = true;
domain = true;
addresses = true;
};
};
};
location.provider = "geoclue2";
# Set default programs
programs.vim.defaultEditor = true;
programs.zsh.enable = true;
environment.pathsToLink = [ "/share/zsh" ];
features = {
yubikey.enable = true;
dnscrypt = {
enable = true;
privateKey = "/etc/nixos-secrets/dnscrypt.pem";
};
mopidy = {
enable = true;
extensionPackages = with pkgs; [
mopidy-iris
mopidy-local
mopidy-youtube
];
mpd = {
enable = true;
};
mediaDirs = [{
name = "Music";
path = "/home/Music";
}];
localMediaDir = "/home/Music";
};
wireguard = {
enable = true;
wirelessInterface = "wlan0";
credentials = credentials.wireguard;
};
vt420.enable = true;
wf-recorder.enable = true;
steam.enable = true;
};
xdg = {
icons.enable = true;
};
nix = {
package = pkgs.nixFlakes;
gc = {
automatic = true;
options = "--delete-older-than 14d";
};
extraOptions = ''
experimental-features = nix-command flakes
keep-outputs = true
keep-derivations = true
'';
};
documentation = {
dev.enable = true;
doc.enable = true;
};
system.copySystemConfiguration = true;
system.stateVersion = "21.05";
}