summaryrefslogtreecommitdiffstats
path: root/lass/1systems/coaxmetal/physical.nix
blob: b033477fec6f83d412bb8e8f1800cdfa8ebb24d5 (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
{ config, lib, pkgs, modulesPath, ... }:
{
  imports = [
    ./config.nix
    (modulesPath + "/installer/scan/not-detected.nix")
  ];

  networking.hostId = "e0c335ea";
  boot.zfs.requestEncryptionCredentials = true;
  boot.zfs.enableUnstable = true;
  boot.loader.efi.canTouchEfiVariables = true;
  boot.loader.grub = {
    enable = true;
    # device = "/dev/disk/by-id/nvme-WDC_PC_SN730_SDBQNTY-1T00-1001_205349800040";
    device = "nodev";
    efiSupport = true;
    # efiInstallAsRemovable = true;
  };

  services.xserver.videoDrivers = [
    "amdgpu"
  ];

  hardware.opengl.extraPackages = [ pkgs.amdvlk ];
  environment.variables.VK_ICD_FILENAMES =
    "/run/opengl-driver/share/vulkan/icd.d/amd_icd64.json";

  boot.initrd.availableKernelModules = [ "nvme" "ehci_pci" "xhci_pci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
  boot.kernelModules = [ "kvm-amd" ];

  fileSystems."/" = {
    device = "zpool/root/root";
    fsType = "zfs";
  };

  fileSystems."/home" = {
    device = "zpool/root/home";
    fsType = "zfs";
  };

  fileSystems."/boot" = {
    device = "/dev/disk/by-uuid/50A7-1889";
    fsType = "vfat";
  };

  services.logind.lidSwitch = "ignore";
  services.logind.lidSwitchDocked = "ignore";

  # Mouse stuff
  services.xserver.libinput.enable = lib.mkForce false;
  services.xserver.synaptics.enable = true;

  services.xserver.displayManager.sessionCommands = ''
    xinput disable 'ETPS/2 Elantech Touchpad'
    xinput set-prop 'ETPS/2 Elantech TrackPoint' 'Evdev Wheel Emulation' 1
    xinput set-prop 'ETPS/2 Elantech TrackPoint' 'Evdev Wheel Emulation Button' 2
    xinput set-prop 'ETPS/2 Elantech TrackPoint' 'Evdev Wheel Emulation Axes' 6 7 4 5
  '';

  # https://forums.lenovo.com/t5/Fedora/T14s-AMD-Trackpoint-almost-unusable/m-p/5064952?page=4
  # https://bugzilla.kernel.org/show_bug.cgi?id=209167#c1
  boot.kernelPatches = [{
    name = "fix-trackpoint-jumping";
    patch = pkgs.fetchurl {
      url = "https://patchwork.kernel.org/project/linux-input/patch/20210729010940.5752-1-phoenix@emc.com.tw/raw/";
      sha256 = "0apbf7c8w830dbdsrmxpip90d5zbg74a939x89jfgpvm5gbdqdjg";
    };
  }];
}