1
Files
flake-nixinator/system/servenix/hardware-configuration.nix
2023-07-11 16:51:44 +02:00

111 lines
3.7 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" "usbhid" "usb_storage" "sd_mod"];
initrd.kernelModules = []; # Initrd modules are always loaded, e.g. when they are required to mount the rootfs
kernelModules = ["kvm-intel" "iwlwifi"];
# kernelModules = ["kvm-amd"];
# extraModprobeConfig = ''
# options iwlwifi 11n_disable=1 wd_disable=0
# '';
# Specific to used kernel (currently linux_zen)
extraModulePackages = with config.boot.kernelPackages; [];
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/611e86c7-67e4-41ce-a7ee-e6639bbe8f07";
fsType = "ext4";
options = [ "noatime" "nodiratime" "discard" ];
};
fileSystems."/boot/efi" = {
device = "/dev/disk/by-uuid/CD5E-E3AB";
fsType = "vfat";
};
fileSystems."/home/christoph/HDD1" = {
device = "/dev/disk/by-uuid/77ae7407-5faa-4d93-8b11-a64ff9a33954";
fsType = "ext4";
};
fileSystems."/home/christoph/HDD2" = {
device = "/dev/disk/by-uuid/4ac26c8e-f9fc-449e-9a80-491558539dbb";
fsType = "ext4";
};
# fileSystems."/home/christoph/SSD1" = {
# device = "/dev/disk/by-uuid/fcea57ce-cd8a-44b0-a4bc-5ac11849dfb6";
# fsType = "ext4";
# options = [ "noatime" "nodiratime" "discard" ];
# };
swapDevices = lib.mkForce [
# {
# device = "/var/swap";
# # size = 1024 * 16 * 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.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;
# nvidia.modesetting.enable = true; # Not officially supported by NVidia but needed for wayland
# video.hidpi.enable = lib.mkDefault true; # No longer has any effect
opengl.enable = true;
# Vulkan
opengl.driSupport = true;
opengl.driSupport32Bit = true;
# AMD: https://nixos.wiki/wiki/AMD_GPU
opengl.extraPackages = with pkgs; [
# amdvlk # RADV (mesa) and AMDVLK (amd) can be used simultaneously
# OpenCL
# rocm-opencl-icd
# rocm-opencl-runtime
# rocm-runtime # Wiki doesn't mention this, but it exists...
# TODO: Disabled for the moment, because hardware acceleration crashes AMDGPU driver
# VAAPI/VDPAU: https://nixos.wiki/wiki/Accelerated_Video_Playback
# vaapiVdpau # Taken from wiki
# 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...
];
};
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
}