This repository has no description
2.5 kB
106 lines
1{ pkgs, modulesPath, ... }:
2{
3 imports = [
4 ./config.nix
5 (modulesPath + "/installer/scan/not-detected.nix")
6 # ../../configs/antimicrox
7 ./disk.nix
8 ];
9
10 networking.hostId = "deadbeef";
11 # boot.loader.efi.canTouchEfiVariables = true;
12 boot.loader.grub = {
13 enable = true;
14 device = "/dev/nvme0n1";
15 efiSupport = true;
16 efiInstallAsRemovable = true;
17 };
18
19 # boot.kernelPackages = pkgs.linuxPackages_latest;
20
21 boot.kernelParams = [
22 # use less power with pstate
23 "amd_pstate=passive"
24
25 # suspend
26 "resume_offset=178345675"
27 ];
28
29 boot.kernelModules = [
30 # Enables the amd cpu scaling https://www.kernel.org/doc/html/latest/admin-guide/pm/amd-pstate.html
31 # On recent AMD CPUs this can be more energy efficient.
32 "amd-pstate"
33 "kvm-amd"
34 ];
35
36 # hardware.cpu.amd.updateMicrocode = true;
37
38 services.xserver.videoDrivers = [
39 "amdgpu"
40 ];
41
42 boot.initrd.availableKernelModules = [
43 "nvme"
44 "thunderbolt"
45 "xhci_pci"
46 "usbhid"
47 ];
48
49 boot.initrd.kernelModules = [
50 "amdgpu"
51 ];
52
53 environment.systemPackages = [
54 pkgs.vulkan-tools
55 ];
56
57 # corectrl
58 programs.corectrl = {
59 enable = true;
60 gpuOverclock = {
61 enable = true;
62 ppfeaturemask = "0xffffffff";
63 };
64 };
65 users.users.mainUser.extraGroups = [ "corectrl" ];
66
67 # keyboard quirks
68 services.xserver.displayManager.sessionCommands = ''
69 ${pkgs.xorg.xmodmap}/bin/xmodmap -e 'keycode 96 = F12 Insert F12 F12' # rebind shift + F12 to shift + insert
70 '';
71 services.udev.extraHwdb = # sh
72 ''
73 # disable back buttons
74 evdev:input:b0003v2F24p0135* # /dev/input/event2
75 KEYBOARD_KEY_70026=reserved
76 KEYBOARD_KEY_70027=reserved
77 '';
78
79 # update cpu microcode
80 hardware.cpu.amd.updateMicrocode = true;
81
82 hardware.graphics.enable = true;
83
84 # suspend to disk
85 swapDevices = [
86 {
87 device = "/swapfile";
88 }
89 ];
90 boot.resumeDevice = "/dev/mapper/aergia1";
91 services.logind.lidSwitch = "suspend-then-hibernate";
92 # systemd.sleep.extraConfig = ''
93 # HibernateDelaySec=1800
94 # '';
95
96 # firefox touchscreen support
97 environment.sessionVariables.MOZ_USE_XINPUT2 = "1";
98
99 # enable thunderbolt
100 services.hardware.bolt.enable = true;
101
102 # reinit usb after docking station connect
103 services.udev.extraRules = ''
104 SUBSYSTEM=="drm", ACTION=="change", RUN+="${pkgs.dash}/bin/dash -c 'echo 0 > /sys/bus/usb/devices/usb9/authorized; echo 1 > /sys/bus/usb/devices/usb9/authorized'"
105 '';
106}