159 lines
4.7 KiB
Nix
159 lines
4.7 KiB
Nix
# 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,
|
||
username,
|
||
...
|
||
}: {
|
||
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
|
||
|
||
boot = {
|
||
initrd.availableKernelModules = [
|
||
"xhci_pci"
|
||
"ahci"
|
||
"nvme"
|
||
"usbhid"
|
||
"usb_storage"
|
||
"sd_mod"
|
||
];
|
||
|
||
initrd.kernelModules = [
|
||
# Enable Nvidia early KMS
|
||
"nvidia"
|
||
"nvidia_modeset"
|
||
"nvidia_uvm"
|
||
"nvidia_drm"
|
||
];
|
||
|
||
initrd.supportedFilesystems = [
|
||
"ext4"
|
||
"btrfs"
|
||
"vfat"
|
||
];
|
||
|
||
kernelModules = [
|
||
"kvm-amd"
|
||
"sg" # Blu-Ray drive
|
||
"zenpower" # Sensors for Zen CPUs: https://github.com/NixOS/nixos-hardware/blob/master/common/cpu/amd/zenpower.nix
|
||
];
|
||
|
||
blacklistedKernelModules = ["k10temp"]; # Disable in favor of zenpower
|
||
|
||
kernelParams = [
|
||
# Enable AMD pstate
|
||
# https://github.com/NixOS/nixos-hardware/blob/master/common/cpu/amd/pstate.nix
|
||
"amd_pstate=active"
|
||
];
|
||
|
||
# extraModprobeConfig = ''
|
||
# options iwlwifi 11n_disable=1 wd_disable=0
|
||
# '';
|
||
|
||
# Specific to used kernel (currently linux_zen)
|
||
extraModulePackages = with config.boot.kernelPackages; [
|
||
v4l2loopback
|
||
zenpower
|
||
];
|
||
};
|
||
|
||
fileSystems = {
|
||
# NOTE: Some filesystems are managed by disko (see ./disks.nix)
|
||
|
||
"/home/${username}/Games" = {
|
||
device = "/dev/disk/by-id/nvme-WD_BLACK_SN850X_2000GB_231623802252-part1";
|
||
fsType = "ext4";
|
||
options = ["defaults" "rw" "noatime"];
|
||
};
|
||
|
||
# If the bg option is specified, a timeout or failure causes the mount(8) command
|
||
# to fork a child which continues to attempt to mount the export.
|
||
# The parent immediately returns with a zero exit code.
|
||
# This is known as a "background" mount.
|
||
|
||
# If the soft option is specified, then the NFS client fails an NFS request
|
||
# after retrans retransmissions have been sent, causing the NFS client to return
|
||
# an error to the calling application.
|
||
# NB: A so-called "soft" timeout can cause silent data corruption in certain cases.
|
||
# As such, use the soft option only when client responsiveness is more important than data integrity.
|
||
# Using NFS over TCP or increasing the value of the retrans option may mitigate
|
||
# some of the risks of using the soft option.
|
||
|
||
"/home/${username}/Movies" = {
|
||
device = "192.168.86.20:/mnt/SG Exos Mirror 18TB/Movie";
|
||
fsType = "nfs";
|
||
options = ["defaults" "rw" "noatime" "_netdev" "bg" "soft"];
|
||
};
|
||
|
||
"/home/${username}/Shows" = {
|
||
device = "192.168.86.20:/mnt/SG Exos Mirror 18TB/Show";
|
||
fsType = "nfs";
|
||
options = ["defaults" "rw" "noatime" "_netdev" "bg" "soft"];
|
||
};
|
||
|
||
"/home/${username}/Music" = {
|
||
device = "192.168.86.20:/mnt/SG Exos Mirror 18TB/Music";
|
||
fsType = "nfs";
|
||
options = ["defaults" "rw" "noatime" "_netdev" "bg" "soft"];
|
||
};
|
||
|
||
"/home/${username}/Restic" = {
|
||
device = "192.168.86.15:/volume1/NixinatorPersistence";
|
||
fsType = "nfs";
|
||
options = ["defaults" "rw" "noatime" "_netdev" "bg" "soft"];
|
||
};
|
||
};
|
||
|
||
hardware = {
|
||
# Use all redistributable firmware (i.e. nonfree)
|
||
enableAllFirmware = true;
|
||
enableRedistributableFirmware = true;
|
||
cpu.amd.updateMicrocode = true;
|
||
bluetooth.enable = true;
|
||
nvidia-container-toolkit.enable = true;
|
||
|
||
nvidia = {
|
||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||
# package = config.boot.kernelPackages.nvidiaPackages.beta;
|
||
|
||
open = true;
|
||
nvidiaSettings = false; # Those are for x-server
|
||
modesetting.enable = true; # Required for wayland
|
||
};
|
||
|
||
# video.hidpi.enable = lib.mkDefault true; # No longer has any effect
|
||
graphics = {
|
||
enable = true;
|
||
enable32Bit = true;
|
||
|
||
# https://nixos.wiki/wiki/Accelerated_Video_Playback
|
||
extraPackages = with pkgs; [
|
||
vaapiVdpau # Taken from wiki, this is also part of nixos-hardware/common/gpu/nvidia
|
||
libvdpau-va-gl # Taken from wiki
|
||
|
||
# https://discourse.nixos.org/t/nvidia-open-breaks-hardware-acceleration/58770/3
|
||
nvidia-vaapi-driver # Experimental, doesn't work with chromium
|
||
];
|
||
};
|
||
|
||
# sane.enable = true; # Scanning
|
||
# xpadneo.enable = true; # Xbox Controller
|
||
};
|
||
|
||
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";
|
||
|
||
# https://wiki.hypr.land/Nvidia/#va-api-hardware-video-acceleration
|
||
NVD_BACKEND = "direct"; # egl
|
||
};
|
||
|
||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
||
}
|