/
hardware-configuration.nix
69 lines (57 loc) · 2.29 KB
/
hardware-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
# Do not modify this file! It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules =
[ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
boot.initrd.luks.devices."crypted".device =
"/dev/disk/by-uuid/01afee33-4f30-40d7-8f36-6de4b9064756";
# compression performance tests:
# https://gist.github.com/braindevices/fde49c6a8f6b9aaf563fb977562aafec
# - chooze lzo emphasizing realtime audio, it has the least overhead
# - nodiscard prevents constant idle writes to nvme, use fstrim.service instead
fileSystems."/" = {
device = "/dev/disk/by-uuid/81e328cf-c6b3-4e1d-b60c-7d818c0fae9f";
fsType = "btrfs";
options =
[ "subvol=root" "noatime" "nodiscard" "space_cache=v2" "compress=lzo" ];
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/D2A8-EC4A";
fsType = "vfat";
};
fileSystems."/home" = {
device = "/dev/disk/by-uuid/81e328cf-c6b3-4e1d-b60c-7d818c0fae9f";
fsType = "btrfs";
options =
[ "subvol=home" "noatime" "nodiscard" "space_cache=v2" "compress=lzo" ];
};
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/81e328cf-c6b3-4e1d-b60c-7d818c0fae9f";
fsType = "btrfs";
options =
[ "subvol=nix" "noatime" "nodiscard" "space_cache=v2" "compress=lzo" ];
};
fileSystems."/backup" = {
device = "/dev/disk/by-uuid/40c284d3-35f3-4f19-b7d3-ee66fce8cfeb";
fsType = "ext4";
options = [ "ro" ];
};
# add more lsblk -o PATH,FSTYPE,UUID
# use zramSwap instead
swapDevices = [ ];
# prevent boot wait for dhcp
networking.dhcpcd.wait = "background";
networking.useDHCP = lib.mkDefault false;
# networking.interfaces.enp37s0.useDHCP = lib.mkDefault true;
# networking.interfaces.enp9s0u1u4u5.useDHCP = lib.mkDefault true;
networking.interfaces.enp9s0u1u2.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
}