dotfiles/nixos/systems/omen/hardware.nix
magic_rb 269a809843
Fix omen's proprietary NVidia driver specialization
Signed-off-by: magic_rb <magic_rb@redalder.org>
2024-03-12 23:24:31 +01:00

89 lines
1.9 KiB
Nix

# SPDX-FileCopyrightText: 2022 Richard Brežák <richard@brezak.sk>
#
# SPDX-License-Identifier: LGPL-3.0-or-later
{
pkgs,
lib,
inputs',
options,
config,
...
}: let
inherit
(lib)
singleton
mkForce
mapAttrs
mkOverride
filter
;
kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
in {
environment.systemPackages = [
kernelPackages.turbostat
];
hardware.cpu.intel.updateMicrocode = true;
boot = {
initrd.systemd.enable = true;
initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"usb_storage"
"sr_mod"
"rtsx_pci_sdmmc"
"nvme"
"vmd"
];
initrd.kernelModules = [];
kernelModules = singleton "kvm-intel";
kernelParams = [
"zfs.zfs_arc_max=8589934592"
"zfs.zfs_arc_sys_free=3221225472"
"nouveau.config=NvGspRm=1"
];
kernelPackages = kernelPackages;
zfs.enableUnstable = true;
supportedFilesystems = singleton "zfs";
};
hardware.enableRedistributableFirmware = true;
hardware.tuxedo-keyboard.enable = true;
imports = [
inputs'.chaotic-nyx.nixosModules.default
];
chaotic.mesa-git.enable = true;
specialisation.nvidia.configuration = {
environment.variables.NIXOS_SPECIALISATION = "nvidia";
boot.loader.grub.enable = mkOverride 0 false;
boot.kernelPackages = mkForce pkgs.linuxPackages_6_6;
hardware.nvidia.package = pkgs.linuxPackages_6_6.nvidia_x11_beta;
boot.kernelParams = [
"nvidia.NVreg_EnableS0ixPowerManagement=1"
"nvidia.NVreg_S0ixPowerManagementVideoMemoryThreshold=2048"
];
chaotic.mesa-git.enable = mkForce false;
hardware.nvidia = {
nvidiaPersistenced = true;
powerManagement.enable = true;
powerManagement.finegrained = true;
prime.reverseSync.enable = false;
prime.offload.enable = true;
modesetting.enable = true;
};
services.xserver.videoDrivers = mkForce ["nvidia"];
};
}