blob: 86610016d255f76af38754370ae4c9c9415de618 (
plain) (
blame)
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
|
{ modulesPath, config, lib, pkgs, ... }:
{
###
### NixOS and Nixpkgs configuration
###
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
system.stateVersion = "25.05";
nixpkgs.config.allowUnfree = true;
###
### Filesystems
###
programs.fuse.userAllowOther = true;
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/4665ceb6-5e13-48fc-81fc-02a7959cd10a";
fsType = "btrfs";
};
"/efi" = {
device = "/dev/disk/by-uuid/796C-8DE8";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
"/data" = {
device = "/dev/disk/by-uuid/2874dc1d-f1b5-4200-a5de-8dd555fa58c8";
fsType = "btrfs";
};
};
swapDevices = [
{ device = "/dev/disk/by-uuid/37e818f5-1460-4f22-8207-5ad94b5ec8c4"; }
];
###
### Bootloader and Linux kernel
###
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.efi.efiSysMountPoint = "/efi";
boot.lanzaboote = {
enable = true;
privateKeyFile = "/etc/secureboot/keys/db/db.key";
publicKeyFile = "/etc/secureboot/keys/db/db.pem";
};
boot.kernelPackages = pkgs.linuxPackages_cachyos;
services.scx.enable = true;
services.scx.package = pkgs.scx_git.full;
services.scx.scheduler = "scx_lavd";
services.scx.extraArgs = [ "--performance" ];
boot.kernelParams = [ "amdgpu.ppfeaturemask=0xfffd7fff" ];
boot.kernelModules = [ "kvm-amd" ];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" ];
# NOTE: We need to load `i915` before `amdgpu` due to Chromium bugs
# Will be removed when Chromium 131 will be released and Electron will upgrade to it
boot.initrd.kernelModules = [ "i915" "amdgpu" "dm-snapshot" ];
###
### Hardware configuration
###
hardware.enableAllFirmware = true;
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.graphics.enable = true;
hardware.graphics.enable32Bit = true;
hardware.bluetooth.enable = true;
hardware.sane.enable = true;
hardware.sane.extraBackends = [ pkgs.hplip ];
hardware.opentabletdriver.enable = true;
services.fstrim.enable = true;
services.keyd.enable = true;
services.upower.enable = true;
musnix.enable = true;
musnix.rtcqs.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
jack.enable = true;
pulse.enable = true;
};
###
### Timezone and Networking
###
time.timeZone = "Europe/Moscow";
networking.hostName = "sapphire";
networking.useDHCP = lib.mkDefault true;
networking.networkmanager.enable = true;
services.resolved.enable = true;
services.openssh.enable = true;
services.openssh.settings.PasswordAuthentication = false;
###
### Software configuration
###
security.rtkit.enable = true;
programs.fish.enable = true;
# NOTE: nushell configuration is not available on NixOS
# programs.nushell.enable = true;
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
programs.dconf.enable = true;
services.dbus.packages = with pkgs; [ dconf gcr ];
environment.systemPackages = with pkgs; [ git git-crypt ];
xdg.portal = {
enable = true;
config.common.default = [ "gtk" "gnome" ];
extraPortals = with pkgs; [ xdg-desktop-portal-gtk xdg-desktop-portal-gnome ];
};
# NOTE: I now use this as alternative to steam-run'ing every precompiled binary
# This should be much easier now, than `steam-run <binary>` every time
services.envfs.enable = true;
programs.nix-ld.enable = true;
programs.nix-ld.libraries = with pkgs; [
acl
attr
bzip2
dbus
expat
fontconfig
freetype
fuse3
icu
libnotify
libsodium
libssh
libunwind
libusb1
libuuid
nspr
nss
stdenv.cc.cc
util-linux
zlib
zstd
# Graphics-related
pipewire
cups
libxkbcommon
pango
mesa
libdrm
libglvnd
libpulseaudio
atk
cairo
alsa-lib
at-spi2-atk
at-spi2-core
gdk-pixbuf
glib
gtk3
libGL
libappindicator-gtk3
vulkan-loader
xorg.libX11
xorg.libXScrnSaver
xorg.libXcomposite
xorg.libXcursor
xorg.libXdamage
xorg.libXext
xorg.libXfixes
xorg.libXi
xorg.libXrandr
xorg.libXrender
xorg.libXtst
xorg.libxcb
xorg.libxkbfile
xorg.libxshmfence
];
}
|