2023-06-11 23:09:59 +02:00
|
|
|
# SPDX-FileCopyrightText: 2022 Richard Brežák <richard@brezak.sk>
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: LGPL-3.0-or-later
|
2023-12-24 17:01:41 +01:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
inputs',
|
|
|
|
options,
|
2024-03-08 21:57:36 +01:00
|
|
|
config,
|
2023-12-24 17:01:41 +01:00
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit
|
|
|
|
(lib)
|
2023-06-11 23:09:59 +02:00
|
|
|
singleton
|
2023-12-24 17:01:41 +01:00
|
|
|
mkForce
|
|
|
|
mapAttrs
|
|
|
|
mkOverride
|
|
|
|
filter
|
|
|
|
;
|
2023-06-11 23:09:59 +02:00
|
|
|
|
2024-05-14 22:36:58 +02:00
|
|
|
kernelPackages = pkgs.linuxKernel.packages.linux_6_8;
|
2023-12-24 17:01:41 +01:00
|
|
|
in {
|
2023-06-11 23:09:59 +02:00
|
|
|
environment.systemPackages = [
|
|
|
|
kernelPackages.turbostat
|
|
|
|
];
|
|
|
|
|
|
|
|
hardware.cpu.intel.updateMicrocode = true;
|
|
|
|
|
|
|
|
boot = {
|
2023-10-03 16:55:14 +02:00
|
|
|
initrd.systemd.enable = true;
|
2023-06-11 23:09:59 +02:00
|
|
|
initrd.availableKernelModules = [
|
|
|
|
"xhci_pci"
|
|
|
|
"ahci"
|
|
|
|
"usb_storage"
|
|
|
|
"sr_mod"
|
|
|
|
"rtsx_pci_sdmmc"
|
|
|
|
"nvme"
|
|
|
|
"vmd"
|
|
|
|
];
|
2024-05-04 21:45:44 +02:00
|
|
|
initrd.kernelModules = [
|
|
|
|
"dm_crypt"
|
|
|
|
"encrypted_keys"
|
|
|
|
"trusted"
|
|
|
|
"nhpoly1305_avx2"
|
|
|
|
"nhpoly1305_sse2"
|
|
|
|
"nhpoly1305"
|
|
|
|
"crypto_null"
|
|
|
|
"polyval_clmulni"
|
|
|
|
"polyval_generic"
|
|
|
|
"gf128mul"
|
|
|
|
"dm_mod"
|
|
|
|
"crypto_simd"
|
|
|
|
"cryptd"
|
|
|
|
"adiantum"
|
|
|
|
"libpoly1305"
|
|
|
|
"libchacha20poly1305"
|
|
|
|
"chacha_x86_64"
|
|
|
|
"libchacha"
|
|
|
|
"poly1305_x86_64"
|
|
|
|
];
|
|
|
|
kernelModules = [
|
|
|
|
"kvm-intel"
|
|
|
|
];
|
2023-06-11 23:09:59 +02:00
|
|
|
|
|
|
|
kernelParams = [
|
|
|
|
"zfs.zfs_arc_max=8589934592"
|
|
|
|
"zfs.zfs_arc_sys_free=3221225472"
|
2024-03-09 17:06:11 +01:00
|
|
|
"nouveau.config=NvGspRm=1"
|
2024-05-14 22:11:33 +02:00
|
|
|
"usbcore.autosuspend=-1"
|
2023-06-11 23:09:59 +02:00
|
|
|
];
|
|
|
|
kernelPackages = kernelPackages;
|
|
|
|
|
|
|
|
zfs.enableUnstable = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
hardware.enableRedistributableFirmware = true;
|
|
|
|
|
|
|
|
hardware.tuxedo-keyboard.enable = true;
|
|
|
|
|
2024-04-19 14:07:44 +02:00
|
|
|
chaotic.mesa-git = {
|
|
|
|
enable = true;
|
|
|
|
fallbackSpecialisation = false;
|
|
|
|
};
|
2024-06-02 17:25:12 +02:00
|
|
|
|
|
|
|
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 = let
|
|
|
|
libPathFor = pkgs:
|
|
|
|
lib.makeLibraryPath (with pkgs; [
|
|
|
|
libdrm
|
|
|
|
xorg.libXext
|
|
|
|
xorg.libX11
|
|
|
|
xorg.libXv
|
|
|
|
xorg.libXrandr
|
|
|
|
xorg.libxcb
|
|
|
|
zlib
|
|
|
|
stdenv.cc.cc
|
|
|
|
wayland
|
|
|
|
# mesa
|
|
|
|
libGL
|
|
|
|
]);
|
|
|
|
in
|
|
|
|
pkgs.linuxPackages_6_6.nvidia_x11_beta.overrideAttrs (old: {
|
|
|
|
postUnpack = ''
|
|
|
|
set -x
|
|
|
|
'';
|
|
|
|
libPath = libPathFor pkgs;
|
|
|
|
libPath32 = libPathFor pkgs.pkgsi686Linux;
|
|
|
|
});
|
|
|
|
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"];
|
|
|
|
};
|
2023-06-11 23:09:59 +02:00
|
|
|
}
|