nixos-config/config/hardware/system3.nix

136 lines
2.8 KiB
Nix
Raw Permalink Normal View History

2021-08-06 16:25:01 -07:00
{ config, lib, pkgs, ... }:
with lib;
2023-11-15 12:22:14 -08:00
let inherit (config.instance) hostname;
2021-08-06 16:25:01 -07:00
in {
2022-04-08 14:21:56 -07:00
system.stateVersion = "21.11";
2021-08-06 16:25:01 -07:00
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;
2021-08-06 16:25:01 -07:00
# 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";
2022-04-08 14:21:56 -07:00
options = [ "noexec" "noatime" ];
2021-08-06 16:25:01 -07:00
};
"/" = {
device = "system3-root";
fsType = "tmpfs";
2022-04-08 14:21:56 -07:00
options = [ "mode=755" "noexec" ];
2021-08-06 16:25:01 -07:00
};
"/nix" = {
2022-04-08 14:21:56 -07:00
device = "/dev/disk/by-label/system3-data";
fsType = "btrfs";
options = [ "subvol=@nix" "compress=zstd" "noatime" ];
2021-08-06 16:25:01 -07:00
};
"/var/log" = {
2022-04-08 14:21:56 -07:00
device = "/dev/disk/by-label/system3-data";
fsType = "btrfs";
options = [ "subvol=@logs" "compress=zstd" "noatime" "noexec" ];
2021-08-06 16:25:01 -07:00
neededForBoot = true;
};
"/state" = {
2022-04-08 14:21:56 -07:00
device = "/dev/disk/by-label/system3-data";
fsType = "btrfs";
options = [ "subvol=@state" "compress=zstd" "noatime" ];
2021-08-06 16:25:01 -07:00
};
"/home" = {
2022-04-08 14:21:56 -07:00
device = "/dev/disk/by-label/system3-data";
fsType = "btrfs";
options = [ "subvol=@home" "compress=zstd" "noatime" ];
2021-08-06 16:25:01 -07:00
};
2024-05-21 23:16:02 -07:00
"/var/lib/tailscale" = {
device = "/dev/disk/by-label/system3-data";
fsType = "btrfs";
options = [ "noatime" "compress=zstd" "noexec" "subvol=@tailscale" ];
};
2021-08-06 16:25:01 -07:00
};
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;
2021-09-18 22:56:56 -07:00
enableAllFirmware = true;
2021-08-06 16:25:01 -07:00
};
services = {
xserver.videoDrivers = [ "amdgpu" ];
compton.backend = "xrender";
};
networking = {
useDHCP = false;
macvlans = {
intif0 = {
2021-09-18 22:56:56 -07:00
interface = "enp7s0";
2021-08-06 16:25:01 -07:00
mode = "bridge";
};
};
interfaces = {
2023-11-15 12:22:14 -08:00
intif0.macAddress =
pkgs.lib.network.generate-mac-address hostname "intif0";
2021-08-06 16:25:01 -07:00
};
};
systemd.targets = {
sleep.enable = false;
suspend.enable = false;
hibernate.enable = false;
hybrid-sleep.enable = false;
};
}