summary refs log tree commit diff
path: root/machines/wolfram/devices.nix
blob: bd3a07ea8ee16a2301546dd090db1d7ee6011167 (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
{ config, pkgs, ... }:

{
  # boot settings
  boot = {
    kernelPackages = pkgs.linuxPackages_latest;

    # do not use default kernel module (r8169) for the realtek rtl8125 ethernet
    # controller, as it has issues with packet loss and can't keep up with the high
    # 2.5g link speed.
    # the out-of-tree module r8125 also has issues however, as apparently when sending
    # off packets the hardware offloading done on the network chip fails massively,
    # corrupting a huge amount of packets, breaking off connections and distorting video.
    # the fix to disable the hardware offloading is handled by systemd-networkd below.
    blacklistedKernelModules = [ "r8169" ];
    extraModulePackages = [ config.boot.kernelPackages.r8125 ];
    kernelModules = [ "r8125" ];

    loader = {
      systemd-boot.enable = true;
      efi.canTouchEfiVariables = true;
    };

    initrd.systemd.enable = true;
  };

  # hardware settings
  hardware = {
    enableRedistributableFirmware = true;
    enableAllFirmware = true;

    graphics = {
      enable = true;
      enable32Bit = true;
      extraPackages = with pkgs; [
        vpl-gpu-rt
        intel-media-driver
        intel-vaapi-driver
        intel-compute-runtime
        intel-ocl
      ];
    };
  };

  # swap alternative
  zramSwap = {
    enable = true;
    algorithm = "zstd";
    swapDevices = 1;
    memoryPercent = 50; 
  };

  # storage
  fileSystems = {
    "/mnt/Kui" = {
      device = "/dev/disk/by-label/Kui";
      fsType = "ext4";
      options = [
        "defaults"
        "users"
        "nofail"
        "exec"
        "rw"
      ];
    };
  };

  # sound
  security.rtkit.enable = true;
  services.pipewire = {
    enable = true;
    alsa = {
      enable = true;
      support32Bit = true;
    };
    pulse.enable = true;
    jack.enable = true;
  };
}