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-03-09 17:06:11 +01:00
|
|
|
kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
|
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"
|
|
|
|
];
|
|
|
|
initrd.kernelModules = [];
|
|
|
|
kernelModules = singleton "kvm-intel";
|
|
|
|
|
|
|
|
kernelParams = [
|
|
|
|
"zfs.zfs_arc_max=8589934592"
|
|
|
|
"zfs.zfs_arc_sys_free=3221225472"
|
2024-03-09 17:06:11 +01:00
|
|
|
"nouveau.config=NvGspRm=1"
|
2023-06-11 23:09:59 +02:00
|
|
|
];
|
|
|
|
kernelPackages = kernelPackages;
|
|
|
|
|
|
|
|
zfs.enableUnstable = true;
|
|
|
|
supportedFilesystems = singleton "zfs";
|
|
|
|
};
|
|
|
|
|
|
|
|
hardware.enableRedistributableFirmware = true;
|
|
|
|
|
|
|
|
hardware.tuxedo-keyboard.enable = true;
|
|
|
|
|
2024-03-09 17:06:11 +01:00
|
|
|
imports = [
|
|
|
|
inputs'.chaotic-nyx.nixosModules.default
|
|
|
|
];
|
|
|
|
chaotic.mesa-git.enable = true;
|
2024-03-08 21:57:36 +01:00
|
|
|
|
2024-03-09 17:06:11 +01:00
|
|
|
specialisation.nvidia.configuration = {
|
|
|
|
environment.variables.NIXOS_SPECIALISATION = "nvidia";
|
2024-03-08 21:57:36 +01:00
|
|
|
boot.loader.grub.enable = mkOverride 0 false;
|
2024-03-09 17:06:11 +01:00
|
|
|
boot.kernelPackages = mkForce pkgs.linuxPackages_6_6;
|
|
|
|
hardware.nvidia.package = pkgs.linuxPackages_6_6.nvidia_x11_beta;
|
2024-03-08 21:57:36 +01:00
|
|
|
boot.kernelParams = [
|
2024-03-09 17:06:11 +01:00
|
|
|
"nvidia.NVreg_EnableS0ixPowerManagement=1"
|
|
|
|
"nvidia.NVreg_S0ixPowerManagementVideoMemoryThreshold=2048"
|
2024-03-08 21:57:36 +01:00
|
|
|
];
|
2024-03-12 23:24:31 +01:00
|
|
|
chaotic.mesa-git.enable = mkForce false;
|
2024-03-08 21:57:36 +01:00
|
|
|
|
2024-03-09 17:06:11 +01:00
|
|
|
hardware.nvidia = {
|
|
|
|
nvidiaPersistenced = true;
|
2024-03-08 21:57:36 +01:00
|
|
|
|
2024-03-09 17:06:11 +01:00
|
|
|
powerManagement.enable = true;
|
|
|
|
powerManagement.finegrained = true;
|
2024-03-08 21:57:36 +01:00
|
|
|
|
|
|
|
prime.reverseSync.enable = false;
|
2024-03-09 17:06:11 +01:00
|
|
|
prime.offload.enable = true;
|
|
|
|
|
|
|
|
modesetting.enable = true;
|
2024-03-08 21:57:36 +01:00
|
|
|
};
|
2024-03-09 17:06:11 +01:00
|
|
|
|
|
|
|
services.xserver.videoDrivers = mkForce ["nvidia"];
|
2024-03-08 21:57:36 +01:00
|
|
|
};
|
2023-06-11 23:09:59 +02:00
|
|
|
}
|