blob: de9ba1b73c88f7fdc04a9122b59a37fa2d10e32a (
plain)
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
|
{ config, lib, pkgs, ... }: {
imports = [
../../configs/bluetooth.nix
../../configs/btrfs-scrub.nix
../../configs/initrd/sshd.nix
../../configs/retiolum.nix
../../configs/wiregrill.nix
../../configs/earlyoom.nix
../../configs/networkd.nix
../../configs/x11
{
### from https://github.com/gkovacs/udev-key-remapping
### Input device ID: bus 0x11 vendor 0x1 product 0x1 version 0xab83
# /dev/input/event1
# /dev/input/by-path/platform-i8042-serio-0-event-kbd
# evdev:input:b<bus_id>v<vendor_id>p<product_id>e<version_id>-<modalias>
# KEY_COMPOSE is Menu in X11
# Keep in sync with pkgs/haskell/xmonad-tv/src/main.hs.
# Changing values here requires udevadm trigger /dev/input/event1 after rebuild.
services.udev.extraHwdb = /* sh */ ''
# Remap top left buttons from KEY_VOLUME{DOWN,UP} to KEY_{CALC,COMPUTER}
evdev:input:b0011v0001p0001*
KEYBOARD_KEY_ae=calc
KEYBOARD_KEY_b0=computer
'';
}
];
services.fwupd.enable = true;
boot.initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"thunderbolt"
"rtsx_pci_sdmmc"
];
boot.initrd.kernelModules = [
"amdgpu"
];
boot.kernelModules = [
"amd-pstate"
"kvm-amd"
];
boot.kernelParams = [
"amd_pstate=active"
# for ryzenadj -i
"iomem=relaxed"
];
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.systemd-boot.enable = true;
boot.loader.systemd-boot.consoleMode = "max";
boot.initrd.luks.devices.main.device = "/dev/nvme0n1p2";
fileSystems."/" = {
device = "/dev/mapper/legvg0-root";
fsType = "btrfs";
options = ["defaults" "noatime" "compress=zstd"];
};
fileSystems."/boot" = {
device = "/dev/nvme0n1p1";
fsType = "vfat";
};
fileSystems."/home" = {
device = "/dev/mapper/legvg0-home";
fsType = "btrfs";
options = ["defaults" "noatime" "compress=zstd"];
};
zramSwap.enable = true;
zramSwap.swapDevices = 1;
hardware.cpu.amd.updateMicrocode = true;
hardware.enableRedistributableFirmware = true;
hardware.sensor.iio.enable = true;
nix.settings.cores = 4;
users.users.root.packages = [
pkgs.ryzenadj
];
boot.kernelPackages = pkgs.linuxPackages_latest;
krebs.build.host = config.krebs.hosts.leg;
system.stateVersion = "23.11";
networking.interfaces.eth1.useDHCP = true;
networking.interfaces.eth1.wakeOnLan.enable = true;
# via EV2740X-BK
networking.interfaces.eth2.useDHCP = true;
networking.interfaces.lindy1.useDHCP = true;
networking.interfaces.lindy2.useDHCP = true;
networking.interfaces.prime1.useDHCP = true;
networking.interfaces.dong4.useDHCP = true;
hrm.network.interfaces = {
eth1.medium = "ethernet";
eth2.medium = "ethernet";
lindy1.medium = "ethernet";
lindy2.medium = "ethernet";
prime1.medium = "ethernet";
dong4.medium = "ethernet";
};
networking.wireless.enable = true;
networking.wireless.interfaces = [
"wlan0"
];
networking.interfaces.wlan0.useDHCP = true;
services.logind.settings.Login.HandlePowerKey = "suspend";
# No need for amdgpu, modesetting is the preferred module, but since 25.11,
# modesetting doesn't show anything beyond the cursor.
services.xserver.modules = [ pkgs.xf86videoamdgpu ];
# The built-in screen is mounted in portrait orientation.
hrm.xserver.configs = {
"80-monitor.conf" = {
Section.Monitor.eDP = {
DisplaySize = [ 120 190 ];
Option.Rotate = "left";
Option.UseEdidDpi = "False";
Option.DPI = "337x342";
};
};
"99-rotate.conf" = {
Section.InputClass."libinput touchscreen catchall" = {
MatchProduct = "NVTK0603:00 0603:F001";
MatchIsTouchscreen = true;
Option.TransformationMatrix = "0 -1 1 1 0 0 0 0 1";
};
Section.Monitor."<default monitor>" = {
Option.Rotate = "left";
};
};
};
services.illum.enable = true;
# master width = master terminal columns * column width / screen width
systemd.user.services."xmonad@".environment = {
XMONAD_MASTER_WIDTH = toString (80 * 14 / 2560.);
XMONAD_MASTER_DELTA = toString (8 * 14 / 2560.);
};
hrm.xresources."*" = {
"DesktopPagerFloat*renderFont" = "true";
"DesktopPagerFloat*faceName" = "iosevka tv 2 Semibold";
"DesktopPagerFloat*faceSize" = "7";
};
}
|