{ config, lib, pkgs, ... }: with lib; let inherit (config.instance) hostname; in { system.stateVersion = "21.11"; boot = { loader = { systemd-boot.enable = true; efi.canTouchEfiVariables = true; }; initrd = { availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; kernelModules = [ "amdgpu" ]; }; kernelModules = [ "kvm-amd" ]; kernelPackages = pkgs.linuxPackages_latest; # kernelPatches = [{ # name = "big-navi"; # patch = null; # extraConfig = '' # DRM_AMD_DC_DCN3_0 y # DRM_AMD_DC_DCN y # ''; # }]; }; fileSystems = { "/boot" = { device = "/dev/disk/by-label/SYS3-BOOT"; fsType = "vfat"; options = [ "noexec" "noatime" ]; }; "/" = { device = "system3-root"; fsType = "tmpfs"; options = [ "mode=755" "noexec" ]; }; "/nix" = { device = "/dev/disk/by-label/system3-data"; fsType = "btrfs"; options = [ "subvol=@nix" "compress=zstd" "noatime" ]; }; "/var/log" = { device = "/dev/disk/by-label/system3-data"; fsType = "btrfs"; options = [ "subvol=@logs" "compress=zstd" "noatime" "noexec" ]; neededForBoot = true; }; "/state" = { device = "/dev/disk/by-label/system3-data"; fsType = "btrfs"; options = [ "subvol=@state" "compress=zstd" "noatime" ]; }; "/home" = { device = "/dev/disk/by-label/system3-data"; fsType = "btrfs"; options = [ "subvol=@home" "compress=zstd" "noatime" ]; }; "/var/lib/tailscale" = { device = "/dev/disk/by-label/system3-data"; fsType = "btrfs"; options = [ "noatime" "compress=zstd" "noexec" "subvol=@tailscale" ]; }; }; swapDevices = [{ device = "/dev/disk/by-label/system3-swap"; }]; hardware = { bluetooth.enable = true; cpu.amd.updateMicrocode = true; opengl = { driSupport = true; driSupport32Bit = true; extraPackages = with pkgs; [ rocm-opencl-icd rocm-opencl-runtime amdvlk driversi686Linux.amdvlk ]; setLdLibraryPath = true; }; pulseaudio = { support32Bit = true; package = pkgs.pulseaudioFull; }; enableRedistributableFirmware = true; enableAllFirmware = true; }; services = { xserver.videoDrivers = [ "amdgpu" ]; compton.backend = "xrender"; }; networking = { useDHCP = false; macvlans = { intif0 = { interface = "enp7s0"; mode = "bridge"; }; }; interfaces = { intif0.macAddress = pkgs.lib.network.generate-mac-address hostname "intif0"; }; }; systemd.targets = { sleep.enable = false; suspend.enable = false; hibernate.enable = false; hybrid-sleep.enable = false; }; }