-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnixos-config.nix
264 lines (221 loc) · 10.8 KB
/
nixos-config.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
{ config, lib, pkgs, ... }:
let
vars = import ./vars.nix;
in
{
imports = [
/etc/nixos/hardware-configuration.nix
<home-manager/nixos>
] ++ (lib.optional vars.server ./server.nix);
# Boot options.
boot = {
kernelParams = [ "quiet" ];
consoleLogLevel = 2;
loader = {
efi.canTouchEfiVariables = true;
timeout = 0;
systemd-boot = {
enable = true;
configurationLimit = 10;
};
};
plymouth = {
enable = true;
theme = "breeze";
};
};
powerManagement.enable = true;
# Bluetooth options
hardware = {
bluetooth = {
enable = true;
powerOnBoot = true;
settings.General = {
Enable = "Source,Sink,Media,Socket";
Experimental = true;
};
};
# pulseaudio = {
# enable = true;
# package = pkgs.pulseaudioFull;
# };
};
# Networking options
networking = {
hostName = vars.hostname;
networkmanager = {
enable = true;
ensureProfiles.profiles = {
eduroam = {
connection = {
id = "eduroam";
uuid = "0b3b1367-b305-4885-932a-48100e1e37b5";
type = "wifi";
};
wifi = {
cloned-mac-address = "stable";
mode = "infrastructure";
ssid = "eduroam";
};
wifi-security = {
key-mgmt = "wpa-eap";
};
"802-1x" = {
anonymous-identity = "[email protected]";
ca-cert = "/home/guibi/.config/cat_installer/ca.pem";
domain-suffix-match = "radius.usherbrooke.ca";
eap = "peap";
identity = vars.eduroam.identity or "";
password = vars.eduroam.password or "";
phase2-auth = "mschapv2";
};
};
UdsS = {
connection = {
id = "UdsS";
uuid = "eb0e0e9c-8aa0-4541-ae59-51aca3dea1b5";
type = "vpn";
autoconnect = "false";
};
vpn = {
authtype = "password";
autoconnect-flags = "0";
certsigs-flags = "0";
cookie-flags = "2";
disable_udp = "no";
enable_csd_trojan = "no";
gateway = "rpv.usherbrooke.ca";
gateway-flags = "2";
gwcert-flags = "2";
lasthost-flags = "0";
pem_passphrase_fsid = "no";
prevent_invalid_cert = "no";
protocol = "anyconnect";
resolve-flags = "2";
stoken_source = "disabled";
useragent = "AnyConnect Linux_64 4.10.07061";
xmlconfig-flags = "0";
service-type = "org.freedesktop.NetworkManager.openconnect";
};
vpn-secrets = {
lasthost = "rpv.usherbrooke.ca";
save_passwords = "yes";
xmlconfig = "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxBbnlDb25uZWN0UHJvZmlsZSB4bWxucz0iaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvZW5jb2RpbmcvIiB4bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIiB4c2k6c2NoZW1hTG9jYXRpb249Imh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL2VuY29kaW5nLyBBbnlDb25uZWN0UHJvZmlsZS54c2QiPg0KCTxDbGllbnRJbml0aWFsaXphdGlvbj4NCgkJPFVzZVN0YXJ0QmVmb3JlTG9nb24gVXNlckNvbnRyb2xsYWJsZT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XJGYWlsb3Zlcj5mYWxzZTwvQ2FwdGl2ZVBvcnRhbFJlbWVkaWF0aW9uQnJvd3NlckZhaWxvdmVyPg0KCQk8QWxsb3dNYW51YWxIb3N0SW5wdXQ+dHJ1ZTwvQWxsb3dNYW51YWxIb3N0SW5wdXQ+DQoJPC9DbGllbnRJbml0aWFsaXphdGlvbj4NCgk8U2VydmVyTGlzdD4NCgkJPEhvc3RFbnRyeT4NCgkJCTxIb3N0TmFtZT5ycHYudXNoZXJicm9va2UuY2E8L0hvc3ROYW1lPg0KCQk8L0hvc3RFbnRyeT4NCgk8L1NlcnZlckxpc3Q+DQo8L0FueUNvbm5lY3RQcm9maWxlPg0K";
};
};
};
};
};
# Global packages
environment.systemPackages = with pkgs; [
git
polkit_gnome
jq socat xdg-utils
brightnessctl
networkmanager-openconnect
gcc
];
# Programs options
programs = {
dconf.enable = true;
hyprland.enable = vars.enable-hyprland or false;
fish.enable = true;
};
# Users options
users = {
defaultUserShell = pkgs.fish;
users.guibi = {
isNormalUser = true;
description = "Laurent";
extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; [];
};
};
home-manager.users.guibi = import ./home.nix;
# Services options
services = {
# Start the gnome keyring (secrets)
gnome.gnome-keyring.enable = true;
# Mount, trash... for the file explorer
gvfs.enable = true;
# Bluetooth control
blueman.enable = true;
# CPU power management
auto-cpufreq.enable = true;
# Fingerprint
fprintd.enable = vars.enable-fprint or false;
# Start Pipewire (audio)
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
# Auto start Hyprland on TTY1
greetd = {
enable = vars.enable-hyprland or false;
settings.default_session = {
command = "${pkgs.hyprland}/bin/Hyprland &> /dev/null";
user = "guibi";
};
};
};
# Security options
security = {
polkit.enable = true;
rtkit.enable = true;
pam.services = {
login.enableGnomeKeyring = true;
hyprlock.enableGnomeKeyring = true;
};
};
# Systemd options
systemd = {
# Start Polkit-Gnome
user.services.polkit-gnome-authentication-agent-1 = {
enable = vars.enable-hyprland or false;
description = "polkit-gnome-authentication-agent-1";
wantedBy = [ "default.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
};
# Session variables
environment.sessionVariables = {
SSH_AUTH_SOCK = "/run/user/$(id -u)/keyring/ssh";
};
# Fonts
fonts.packages = with pkgs; [
cascadia-code
nerd-fonts.fira-code
noto-fonts
noto-fonts-emoji
liberation_ttf
dina-font
proggyfonts
];
# Locale options
console.keyMap = "cf";
time.timeZone = "America/Toronto";
i18n.defaultLocale = "en_CA.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "fr_CA.UTF-8";
LC_IDENTIFICATION = "fr_CA.UTF-8";
LC_MEASUREMENT = "fr_CA.UTF-8";
LC_MONETARY = "fr_CA.UTF-8";
LC_NAME = "fr_CA.UTF-8";
LC_NUMERIC = "fr_CA.UTF-8";
LC_PAPER = "fr_CA.UTF-8";
LC_TELEPHONE = "fr_CA.UTF-8";
LC_TIME = "fr_CA.UTF-8";
};
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# No touchy
system.stateVersion = "23.11";
}