1
Files
flake-nixinator/system/nixinator/hardware-configuration.nix

150 lines
5.2 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 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 = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"];
# Enable early Nvidia kernel modesetting
# https://wiki.archlinux.org/title/GDM#GDM_ignores_Wayland_and_uses_X.Org_by_default (not fixed by this)
# https://wiki.archlinux.org/title/Kernel_mode_setting#Early_KMS_start
initrd.kernelModules = ["nvidia" "nvidia_modeset" "nvidia_uvm" "nvidia_drm"]; # NVIDIA
# initrd.kernelModules = ["amdgpu"]; # Initrd modules are always loaded, e.g. when they are required to mount the rootfs
# kernelModules = ["kvm-intel" "iwlwifi"];
kernelModules = ["kvm-amd" "sg"]; # sg is for blu ray drive
# extraModprobeConfig = ''
# options iwlwifi 11n_disable=1 wd_disable=0
# '';
# Specific to used kernel (currently linux_zen)
extraModulePackages = with config.boot.kernelPackages; [
# new-lg4ff # Logitech force feedback
v4l2loopback
];
};
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/68bd46a0-e95c-4764-a006-44bd9975a6c2";
fsType = "ext4";
options = ["defaults" "rw" "relatime"];
};
"/boot/efi" = {
device = "/dev/disk/by-uuid/36A9-3D74";
fsType = "vfat";
};
"/home/christoph/Games" = {
device = "/dev/disk/by-uuid/e57c1831-09d7-4046-9c62-086d3596f825";
fsType = "ext4";
options = ["defaults" "rw" "relatime"];
};
"/home/christoph/Movies" = {
device = "192.168.86.20:/mnt/SG Exos Mirror 18TB/Movie";
fsType = "nfs";
options = ["defaults" "rw" "relatime" "_netdev" "bg"];
};
"/home/christoph/Shows" = {
device = "192.168.86.20:/mnt/SG Exos Mirror 18TB/Show";
fsType = "nfs";
options = ["defaults" "rw" "relatime" "_netdev" "bg"];
};
"/home/christoph/Music" = {
device = "192.168.86.20:/mnt/SG Exos Mirror 18TB/Music";
fsType = "nfs";
options = ["defaults" "rw" "relatime" "_netdev" "bg"];
};
};
swapDevices = lib.mkForce [
# {
# device = "/var/swap";
# # size = 1024 * 32 * 2; # twice the RAM for hibernation
# size = 1024 * 8; # Without hibernation 4.0 GB to 0.5 x RAM
# }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault false; # NOTE: Set to false bc systemd-networkd
networking.enableIPv6 = lib.mkDefault false; # NOTE: Could be overwritten by systemd-networkd
# networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
# networking.interfaces.enp4s0u2.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
# networking.networkmanager.enable = true;
# networking.wireless.iwd.enable = true;
# networking.networkmanager.wifi.backend = "iwd";
# nixpkgs.config.allowUnfree = true;
hardware = {
# Use all redistributable firmware (i.e. nonfree)
enableAllFirmware = true;
enableRedistributableFirmware = true;
# cpu.intel.updateMicrocode = true;
cpu.amd.updateMicrocode = true;
bluetooth.enable = true;
nvidia = {
package = config.boot.kernelPackages.nvidiaPackages.stable;
# package = config.boot.kernelPackages.nvidiaPackages.beta; # NOTE: Beta, might (?) prevent discord screen-share
modesetting.enable = true; # Not officially supported by NVidia but needed for wayland
open = false; # TODO: Build failure on 2024-18-01
nvidiaSettings = false; # Those are for x-server
};
# video.hidpi.enable = lib.mkDefault true; # No longer has any effect
graphics = {
enable = true;
enable32Bit = true;
# AMD: https://nixos.wiki/wiki/AMD_GPU
extraPackages = with pkgs; [
# amdvlk # RADV (mesa) and AMDVLK (amd) can be used simultaneously
# VAAPI/VDPAU: https://nixos.wiki/wiki/Accelerated_Video_Playback
vaapiVdpau # Taken from wiki, this is also part of nixos-hardware/common/gpu/nvidia
libvdpau-va-gl # Taken from wiki
libvdpau # NOTE: Don't know if needed/where it belongs...
libva # NOTE: Don't know if needed/where it belongs...
nvidia-vaapi-driver # Experimental, doesn't work with chromium
];
};
# sane.enable = true; # Scanning
# xpadneo.enable = true; # Xbox Controller
};
# environment.variables.AMD_VULKAN_ICD = "RADV"; # Choose mesa driver by default
environment.variables = {
GBM_BACKEND = "nvidia-drm";
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
# https://github.com/elFarto/nvidia-vaapi-driver?tab=readme-ov-file#environment-variables
LIBVA_DRIVER_NAME = "nvidia";
NVD_BACKEND = "egl";
};
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
}