Files
dotfiles/system-modules/hardware-configuration.nix
Lennart J. Kurzweg (Nx2) 66ef004344 added NxACE (untested)
2024-05-04 12:10:42 +02:00

57 lines
2.0 KiB
Nix

{ config, lib, user, host, pkgs, modulesPath, ... }:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
environment.systemPackages = if host == "NxNORTH" then with pkgs; [
ntfs3g
btrfs-progs
] else if host == "NxXPS" then with pkgs; [
ntfs3g
] else [];
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "vmd" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
# boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems = if host != "NxACE" then {
"/" = { device = "/dev/disk/by-label/nixos"; fsType = "ext4"; };
"/boot" = { device = "/dev/disk/by-label/EFI"; fsType = "vfat"; };
"/home/${user}/shared" = { device = "/dev/disk/by-label/shared"; fsType = if host == "NxXPS" then "ntfs" else "btrfs"; };
} else {
"/" = { device = "/dev/disk/by-label/nixos"; fsType = "ext4"; };
"/boot" = { device = "/dev/disk/by-label/EFI"; fsType = "vfat"; };
"/vault" = { device = "/dev/disk/by-label/vault"; fsType = "ext4"; };
};
swapDevices = [
{ device = "/dev/disk/by-label/swap"; }
];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
# from nixos-hardware
services.thermald.enable = lib.mkDefault true;
boot.extraModprobeConfig = if host == "NxXPS" then ''
options iwlwifi 11n_disable=8
'' else "";
boot.initrd.kernelModules = if host == "NxXPS" then [ "i915" ] else [];
environment.variables = if host == "NxXPS" then {
VDPAU_DRIVER = lib.mkIf config.hardware.opengl.enable (lib.mkDefault "va_gl");
} else {};
hardware.opengl.extraPackages = if host == "NxXPS" then with pkgs; [
(if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then vaapiIntel else intel-vaapi-driver)
libvdpau-va-gl
intel-media-driver
] else [];
}