78 lines
2.3 KiB
Nix
78 lines
2.3 KiB
Nix
# Hardware configuration for desktop
|
|
# Generated by running: nixos-generate-config --show-hardware-config
|
|
# This file contains hardware-specific settings that should be adjusted for your actual hardware
|
|
|
|
{ config, lib, modulesPath, ... }:
|
|
|
|
{
|
|
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
|
|
|
# Kernel modules needed during boot
|
|
# Adjust based on your hardware (NVMe, SATA, USB, etc.)
|
|
boot.initrd.availableKernelModules =
|
|
[ "nvme" "xhci_pci" "ahci" "usb_storage" "sd_mod" ];
|
|
boot.initrd.kernelModules = [ ];
|
|
boot.kernelModules = [ "kvm-amd" ]; # Change to "kvm-intel" for Intel CPUs
|
|
|
|
# Filesystem configuration
|
|
# Run `lsblk -f` or `blkid` to get your actual device UUIDs
|
|
fileSystems."/" = {
|
|
device = "/dev/disk/by-uuid/REPLACE-WITH-YOUR-ROOT-UUID";
|
|
fsType = "ext4";
|
|
};
|
|
|
|
fileSystems."/boot" = {
|
|
device = "/dev/disk/by-uuid/REPLACE-WITH-YOUR-BOOT-UUID";
|
|
fsType = "vfat";
|
|
options = [ "fmask=0022" "dmask=0022" ];
|
|
};
|
|
|
|
# Swap configuration (optional)
|
|
# Uncomment and adjust if you have a swap partition
|
|
# swapDevices = [
|
|
# { device = "/dev/disk/by-uuid/REPLACE-WITH-YOUR-SWAP-UUID"; }
|
|
# ];
|
|
|
|
# CPU microcode updates
|
|
hardware.cpu.amd.updateMicrocode =
|
|
lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
# For Intel CPUs, use this instead:
|
|
# hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
|
|
# GPU configuration
|
|
# Uncomment the section that matches your GPU
|
|
|
|
# NVIDIA GPU
|
|
# services.xserver.videoDrivers = [ "nvidia" ];
|
|
# hardware.nvidia = {
|
|
# modesetting.enable = true;
|
|
# powerManagement.enable = false;
|
|
# powerManagement.finegrained = false;
|
|
# open = false; # Use proprietary driver
|
|
# nvidiaSettings = true;
|
|
# package = config.boot.kernelPackages.nvidiaPackages.stable;
|
|
# };
|
|
|
|
# AMD GPU
|
|
# services.xserver.videoDrivers = [ "amdgpu" ];
|
|
# hardware.opengl = {
|
|
# enable = true;
|
|
# driSupport = true;
|
|
# driSupport32Bit = true; # For 32-bit games
|
|
# };
|
|
|
|
# Intel GPU
|
|
# services.xserver.videoDrivers = [ "modesetting" ];
|
|
# hardware.opengl = {
|
|
# enable = true;
|
|
# extraPackages = with pkgs; [
|
|
# intel-media-driver
|
|
# vaapiIntel
|
|
# vaapiVdpau
|
|
# libvdpau-va-gl
|
|
# ];
|
|
# };
|
|
|
|
# Maximum number of open files
|
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
|
}
|