-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfiguration.nix
518 lines (470 loc) · 14.1 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
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
{ config, lib, pkgs, agenix, nix-colors, ... }:
let
system = "x86_64-linux";
in
{
#nixpkgs.config.allowUnfree = true;
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
nix-colors.homeManagerModules.default
#home-manager.nixosModules.default
];
nix.settings.experimental-features = ["nix-command" "flakes"];
# Use the systemd-boot EFI boot loader.
# boot.loader.systemd-boot.enable = true;
# boot.loader.systemd-boot.configurationLimit = 5;
# boot.loader.efi.canTouchEfiVariables = true;
colorScheme = {
slug = "adamsmasher";
name = "AdamSmasher";
author = "Carlos Craveiro (https://github.com/CarlosCraveiro)";
palette = {
base00 = "#01000E";
base01 = "#071923";
base02 = "#192A24";
base03 = "#595495";
base04 = "#A0C7E5";
base05 = "#FC3636";
base06 = "#17263B";
base07 = "#FC3636"; # Left unset
base08 = "#49EF8C";
base09 = "#D1F640";
base0A = "#7BA9EF";
base0B = "#509999";
base0C = "#64D6BE";
base0D = "#C2D1CC";
base0E = "#FBD9AB";
base0F = "#912626";
};
};
boot.loader.grub.enable = true;
boot.loader.grub.configurationLimit = 5;
boot.loader.grub.copyKernels = true;
boot.loader.grub.efiInstallAsRemovable = true;
boot.loader.grub.efiSupport = true;
boot.loader.grub.fsIdentifier = "label";
boot.loader.grub.theme = pkgs.stdenv.mkDerivation {
pname = "yorha-grub-themes";
version = "3.1";
src = pkgs.fetchFromGitHub {
owner = "CarlosCraveiro";
repo = "yorha-grub-theme";
rev = "v1.0";
hash = "sha256-XVzYDwJM7Q9DvdF4ZOqayjiYpasUeMhAWWcXtnhJ0WQ=";
};
installPhase = "cp -r ./yorha-1920x1080 $out";
};
boot.loader.grub.useOSProber = true;
boot.loader.grub.devices = [ "nodev" ];
boot.loader.grub.extraEntries = ''
menuentry "Reboot" {
reboot
}
menuentry "Poweroff" {
halt
}
'';
networking.hostName = "roxanne"; # Define your hostname.
# Pick only one of the below networking options.
#networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
#age.secretsDir = ./secrets;
#age.secrets.eduruim.file = builtins.toPath /home/coveiro/.config/nixos/secrets/eduruim.age;
age.secrets.casa_dollars5g.file = builtins.toPath /home/coveiro/.config/nixos/secrets/casa_dollars5g.age;
age.secrets.nusp.file = builtins.toPath /home/coveiro/.config/nixos/secrets/nusp.age;
age.secrets.susp.file = builtins.toPath /home/coveiro/.config/nixos/secrets/susp.age;
age.secrets.celular_dollars.file = builtins.toPath /home/coveiro/.config/nixos/secrets/celular_dollars.age;
age.secrets.casa_bia.file = builtins.toPath /home/coveiro/.config/nixos/secrets/casa_bia.age;
age.secrets.casa_fael5g.file = builtins.toPath /home/coveiro/.config/nixos/secrets/casa_fael5g.age;
age.secrets.vonbraunsanca.file = builtins.toPath /home/coveiro/.config/nixos/secrets/vonbraunsanca.age;
age.secrets.casa_jade5g.file = builtins.toPath /home/coveiro/.config/nixos/secrets/casa_jade5g.age;
age.secrets.casa_fortal.file = builtins.toPath /home/coveiro/.config/nixos/secrets/casa_fortal.age;
age.secrets.casa_talma.file = builtins.toPath /home/coveiro/.config/nixos/secrets/casa_talma.age;
age.secrets.jade_rioclaro.file = builtins.toPath /home/coveiro/.config/nixos/secrets/jade_rioclaro.age;
#networking.nameservers = ["1.1.1.1" "9.9.9.9"];
networking.wireless = {
enable = true;
userControlled.enable = true;
networks = {
eduroam =
let
rawnusp = builtins.readFile config.age.secrets.nusp.path;
nusp = builtins.replaceStrings ["\n" " "] ["" ""] rawnusp;
rawsusp = builtins.readFile config.age.secrets.susp.path;
passwd = builtins.replaceStrings ["\n" " "] ["" " "] rawsusp;
in
{
auth = ''
proto=RSN
key_mgmt=WPA-EAP
pairwise=CCMP
auth_alg=OPEN
eap=PEAP
identity="${nusp}@usp.br"
password="${passwd}"
phase2="auth=MSCHAPV2"
'';
};
DOLLARS_5GHz =
let
raw = builtins.readFile config.age.secrets.casa_dollars5g.path;
passwd = builtins.replaceStrings ["\n" " "] ["" ""] raw;
in
{
auth = ''
psk="${passwd}"
'';
};
VBC_PISO_2_B =
let
raw = builtins.readFile config.age.secrets.vonbraunsanca.path;
passwd = builtins.replaceStrings ["\n" " "] ["" ""] raw;
in
{
auth = ''
psk="${passwd}"
'';
};
Jade5G =
let
raw = builtins.readFile config.age.secrets.casa_jade5g.path;
passwd = builtins.replaceStrings ["\n" " "] ["" ""] raw;
in
{
auth = ''
psk="${passwd}"
'';
};
DOLARS_NET =
let
raw = builtins.readFile config.age.secrets.celular_dollars.path;
passwd = builtins.replaceStrings ["\n" " "] ["" ""] raw;
in
{
auth = ''
psk="${passwd}"
'';
};
Apto_201_5G =
let
raw = builtins.readFile config.age.secrets.casa_fael5g.path;
passwd = builtins.replaceStrings ["\n" " "] ["" ""] raw;
in
{
auth = ''
psk="${passwd}"
'';
};
"Laplace.net" =
let
raw = builtins.readFile config.age.secrets.casa_bia.path;
passwd = builtins.replaceStrings ["\n" " "] ["" ""] raw;
in
{
auth = ''
psk="${passwd}"
'';
};
CLARO_2GF01F5B =
let
raw = builtins.readFile config.age.secrets.casa_fortal.path;
passwd = builtins.replaceStrings ["\n" " "] ["" ""] raw;
in
{
auth = ''
psk="${passwd}"
'';
};
CLARO_5GF01F5B =
let
raw = builtins.readFile config.age.secrets.casa_fortal.path;
passwd = builtins.replaceStrings ["\n" " "] ["" ""] raw;
in
{
auth = ''
psk="${passwd}"
'';
};
"TC NETWORK 5G_xt" =
let
raw = builtins.readFile config.age.secrets.casa_talma.path;
passwd = builtins.replaceStrings ["\n" " "] ["" ""] raw;
in
{
auth = ''
psk="${passwd}"
'';
};
"TC NETWORK_xt" =
let
raw = builtins.readFile config.age.secrets.casa_talma.path;
passwd = builtins.replaceStrings ["\n" " "] ["" ""] raw;
in
{
auth = ''
psk="${passwd}"
'';
};
CLARO_erados5g =
let
raw = builtins.readFile config.age.secrets.jade_rioclaro.path;
passwd = builtins.replaceStrings ["\n" " "] ["" ""] raw;
in
{
auth = ''
psk="${passwd}"
'';
};
"Era dos Extremos" =
let
raw = builtins.readFile config.age.secrets.jade_rioclaro.path;
passwd = builtins.replaceStrings ["\n" " "] ["" ""] raw;
in
{
auth = ''
psk="${passwd}"
'';
};
claroeradosextremos =
let
raw = builtins.readFile config.age.secrets.jade_rioclaro.path;
passwd = builtins.replaceStrings ["\n" " "] ["" ""] raw;
in
{
auth = ''
psk="${passwd}"
'';
};
};
};
# Set your time zone.
time.timeZone = "America/Sao_Paulo";
programs.zsh.enable = true;
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Select internationalisation properties.
# i18n.defaultLocale = "en_US.UTF-8";
# console = {
# font = "Lat2-Terminus16";
# keyMap = "us";
# useXkbConfig = true; # use xkbOptions in tty.
# };
environment.pathsToLink = [ "/libexec" ];
environment.variables.EDITOR = "nvim";
# Enable the X11 windowing system.
services = {
displayManager = {
defaultSession = "none+i3";
#lightdm.enable = true;
autoLogin.enable = true;
autoLogin.user = "coveiro";
};
xserver = {
enable = true;
#extraConfig = ''
#Section "Device"
# Identifier "Intel Graphics"
# Driver "Intel"
#EndSection
#'';
monitorSection = ''
'';
xkb.layout = "br,us,jp";
xkb.variant = ",alt-intl,kana";
xkb.options = "grp:win_space_toggle";
desktopManager = {
xterm.enable = false;
};
displayManager = {
# defaultSession = "none+i3";
lightdm.enable = true;
# autoLogin.enable = true;
# autoLogin.user = "coveiro";
};
windowManager.i3 = {
enable = true;
extraPackages = with pkgs ;[
dmenu
i3status
i3lock-fancy-rapid
];
};
};
};
programs.xss-lock = {
enable = true;
extraOptions = [
"--transfer-sleep-lock"
]; # 5 pixel
lockerCommand = "${pkgs.i3lock-fancy-rapid}/bin/i3lock-fancy-rapid 5 pixel -k --inside-color=#${config.colorScheme.palette.base00} --ring-color=#${config.colorScheme.palette.base0C} --insidever-color=#${config.colorScheme.palette.base00} --ringver-color=#${config.colorScheme.palette.base0A} --insidewrong-color=#${config.colorScheme.palette.base00} --ringwrong-color=#${config.colorScheme.palette.base05} --keyhl-color=#${config.colorScheme.palette.base08} --bshl-color=#${config.colorScheme.palette.base0F} --verif-color=#${config.colorScheme.palette.base04} --wrong-color=#${config.colorScheme.palette.base04} --modif-color=#${config.colorScheme.palette.base04} --layout-color=#${config.colorScheme.palette.base0C} --time-color=#${config.colorScheme.palette.base0C} --date-color=#${config.colorScheme.palette.base0C} --greeter-color=#${config.colorScheme.palette.base0C}";
};
###############################
## Input Method Editor (IME) ##
###############################
# This enables "fcitx" as your IME. This is an easy-to-use IME. It supports many different input methods.
#i18n.inputMethod.enabled = "fcitx5";
# This enables "mozc" as an input method in "fcitx". This has a relatively
# complete dictionary. I recommend it for Japanese input.
#i18n.inputMethod.fcitx5.addons = with pkgs; [ fcitx5-mozc fcitx5-gtk ];
# Configure keymap in X11
# services.xserver.layout = "us";
# services.xserver.xkbOptions = {
# "eurosign:e";
# "caps:escape" # map caps to escape.
# };
fonts = {
packages = with pkgs; [
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
fira-code
fira-code-symbols
(nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" ]; })
];
};
# Enable CUPS to print documents.
# services.printing.enable = true;
# Enable bluetooth
hardware.bluetooth.enable = true;
services.blueman.enable = true;
# Enable sound.
#hardware.pulseaudio.enable = true;
#hardware.pulseaudio.support32Bit = true;
# rtkit is optional but recommended
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
jack.enable = true;
};
# Enable touchpad support (enabled default in most desktopManager).
services.xserver.libinput.enable = true;
# Sets Zsh as a default shell for any user
users.defaultUserShell = pkgs.zsh;
# Define a user account. Don't forget to set a password with ‘passwd’.
users.users.coveiro = {
isNormalUser = true;
home = "/home/coveiro";
description = "Carlos Craveiro";
extraGroups = [ "video" "wheel" "audio" "optical" ];
packages = with pkgs; [
];
};
xdg.portal = {
enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
config = {
common.default = ["gtk"];
};
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
translate-shell
newsflash
stremio
xdg-desktop-portal
brave
xdragon
imagemagick
okular
zotero
vim
wget
zsh
kitty
git
neofetch
btop
feh
zathura
comma
maim
xclip
verilator
yosys
ghdl
rlwrap
tcl
tcllib
links2
distrobox
qemu
libnotify
anki
telegram-desktop
openconnect
anydesk
direnv
tldr
agenix.packages.x86_64-linux.default
(pkgs.sdcc.override { withGputils = true; })
simulide
gputils
podman
kicad
zip
unzip
onlyoffice-bin
freecad
mpv
numlockx
man-pages
man-pages-posix
inkscape
bat
just
tomato-c
texliveFull
statix
alejandra
retroarchFull
tree
cowsay
];
programs.light.enable = true;
#virtualisation.docker.enable = true;
virtualisation.podman = {
enable = true;
dockerCompat = 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;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
};
};
# Man Pages
documentation.dev.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.
# system.copySystemConfiguration = 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?
}