reorganized hardware files and enabled firmware

This commit is contained in:
Aly Raffauf 2024-06-14 21:18:00 -04:00
parent 56823c5c11
commit 08d98ade6f
6 changed files with 194 additions and 155 deletions

View file

@ -1,9 +1,9 @@
{
config,
lib,
pkgs,
modulesPath,
inputs,
lib,
modulesPath,
pkgs,
...
}: {
imports = [
@ -11,41 +11,50 @@
inputs.nixos-hardware.nixosModules.framework-11th-gen-intel
];
boot.initrd.availableKernelModules = ["xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
boot = {
initrd = {
availableKernelModules = ["xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod"];
kernelModules = [];
};
# Intel drivers with accelerated video playback support.
nixpkgs.config.packageOverrides = pkgs: {
intel-vaapi-driver =
pkgs.intel-vaapi-driver.override {enableHybridCodec = true;};
extraModulePackages = [];
kernelModules = ["kvm-intel"];
};
hardware.opengl = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver # LIBVA_DRIVER_NAME=iHD
intel-vaapi-driver # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
libvdpau-va-gl
];
# Intel drivers with accelerated video playback support.
nixpkgs = {
config.packageOverrides = pkgs: {
intel-vaapi-driver =
pkgs.intel-vaapi-driver.override {enableHybridCodec = true;};
};
hostPlatform = lib.mkDefault "x86_64-linux";
};
hardware = {
cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
enableAllFirmware = true;
opengl = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver # LIBVA_DRIVER_NAME=iHD
intel-vaapi-driver # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
libvdpau-va-gl
];
};
};
environment.sessionVariables = {
LIBVA_DRIVER_NAME = "iHD";
}; # Force intel-media-driver
LIBVA_DRIVER_NAME = "iHD"; # Force intel-media-driver
};
# Save power/better manage heat & fans.
powerManagement.powertop.enable = true;
services.thermald.enable = true;
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -3,10 +3,10 @@
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
inputs,
lib,
modulesPath,
pkgs,
...
}: {
imports = [
@ -14,33 +14,36 @@
inputs.nixos-hardware.nixosModules.framework-13-7040-amd
];
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-amd" "amd-gpu"];
boot.kernelParams = ["amdgpu.abmlevel=0"];
boot.extraModulePackages = [];
boot = {
initrd = {
availableKernelModules = ["nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod"];
kernelModules = [];
};
hardware.opengl = {
## radv: an open-source Vulkan driver from freedesktop
driSupport = true;
driSupport32Bit = true;
extraModulePackages = [];
kernelModules = ["kvm-amd" "amd-gpu"];
kernelParams = ["amdgpu.abmlevel=0"];
};
## amdvlk: an open-source Vulkan driver from AMD
extraPackages = [pkgs.rocmPackages.clr.icd pkgs.amdvlk];
extraPackages32 = [pkgs.driversi686Linux.amdvlk];
hardware = {
cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
enableAllFirmware = true;
opengl = {
## radv: an open-source Vulkan driver from freedesktop
driSupport = true;
driSupport32Bit = true;
## amdvlk: an open-source Vulkan driver from AMD
extraPackages = [pkgs.rocmPackages.clr.icd pkgs.amdvlk];
extraPackages32 = [pkgs.driversi686Linux.amdvlk];
};
};
services.xserver.videoDrivers = ["amdgpu"];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp193s0f3u1c2.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -30,16 +30,21 @@
hardware = {
cpu.amd.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
enableAllFirmware = true;
nvidia = {
modesetting.enable = true;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
opengl = {
driSupport = true;
driSupport32Bit = true;
};
};
services.xserver.videoDrivers = ["nvidia"];
networking.useDHCP = lib.mkDefault true;

View file

@ -1,9 +1,9 @@
{
config,
lib,
pkgs,
modulesPath,
inputs,
lib,
modulesPath,
pkgs,
...
}: {
imports = [
@ -12,43 +12,55 @@
inputs.nixos-hardware.nixosModules.common-pc-ssd
];
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-amd" "amdgpu"];
boot.extraModulePackages = [];
boot = {
initrd = {
availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "sd_mod"];
kernelModules = [];
};
kernelModules = ["kvm-amd" "amdgpu"];
};
services.xserver = {
# Add AMDGPU driver.
videoDrivers = ["amdgpu"];
videoDrivers = ["amdgpu"]; # Add AMDGPU driver.
};
hardware.opengl = {
enable = true;
# Add ROCM annd AMD Vulkan driver.
extraPackages = with pkgs; [rocmPackages.clr.icd amdvlk];
# Add support for 32bit apps.
driSupport32Bit = true;
extraPackages32 = with pkgs; [driversi686Linux.amdvlk];
hardware = {
cpu.amd.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
enableAllFirmware = true;
opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
extraPackages = with pkgs; [rocmPackages.clr.icd amdvlk];
extraPackages32 = with pkgs; [driversi686Linux.amdvlk];
};
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/c4217c88-3101-434b-8321-58e2ac89527c";
fsType = "ext4";
};
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/c4217c88-3101-434b-8321-58e2ac89527c";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/3445-B2A0";
fsType = "vfat";
};
"/boot" = {
device = "/dev/disk/by-uuid/3445-B2A0";
fsType = "vfat";
};
fileSystems."/mnt/Archive" = {
device = "/dev/disk/by-uuid/f7e9e6d6-2bf6-429a-aaf0-49b55d53fc83";
fsType = "ext4";
};
"/mnt/Archive" = {
device = "/dev/disk/by-uuid/f7e9e6d6-2bf6-429a-aaf0-49b55d53fc83";
fsType = "ext4";
};
fileSystems."/mnt/Media" = {
device = "/dev/disk/by-uuid/d988d5ca-f9d6-4d85-aa0e-8a437b3c859a";
fsType = "ext4";
"/mnt/Media" = {
device = "/dev/disk/by-uuid/d988d5ca-f9d6-4d85-aa0e-8a437b3c859a";
fsType = "ext4";
};
};
swapDevices = [
@ -58,14 +70,7 @@
}
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp4s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -1,9 +1,9 @@
{
config,
lib,
pkgs,
modulesPath,
inputs,
lib,
modulesPath,
pkgs,
...
}: {
imports = [
@ -12,45 +12,52 @@
inputs.nixos-hardware.nixosModules.common-pc-laptop-ssd
];
boot.initrd.availableKernelModules = ["xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
boot = {
initrd = {
availableKernelModules = ["xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod"];
kernelModules = [];
};
# Intel drivers with accelerated video playback support.
nixpkgs.config.packageOverrides = pkgs: {
intel-vaapi-driver =
pkgs.intel-vaapi-driver.override {enableHybridCodec = true;};
extraModulePackages = [];
kernelModules = ["kvm-intel"];
};
hardware.opengl = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver # LIBVA_DRIVER_NAME=iHD
intel-vaapi-driver # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
libvdpau-va-gl
];
# Intel drivers with accelerated video playback support.
nixpkgs = {
config.packageOverrides = pkgs: {
intel-vaapi-driver =
pkgs.intel-vaapi-driver.override {enableHybridCodec = true;};
};
hostPlatform = lib.mkDefault "x86_64-linux";
};
hardware = {
cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
enableAllFirmware = true;
opengl = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver # LIBVA_DRIVER_NAME=iHD
intel-vaapi-driver # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
libvdpau-va-gl
];
};
sensor.iio.enable = true; # Enable auto-rotate and tablet mode.
};
environment.sessionVariables = {
LIBVA_DRIVER_NAME = "iHD";
}; # Force intel-media-driver
# Enable auto-rotate and tablet mode.
hardware.sensor.iio.enable = true;
LIBVA_DRIVER_NAME = "iHD"; # Force intel-media-driver
};
# Save power/better manage heat & fans.
powerManagement.powertop.enable = true;
services.thermald.enable = true;
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -1,9 +1,9 @@
{
config,
lib,
pkgs,
modulesPath,
inputs,
lib,
modulesPath,
pkgs,
...
}: {
imports = [
@ -12,46 +12,56 @@
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t440p
];
boot.initrd.availableKernelModules = [
"xhci_pci"
"ehci_pci"
"ahci"
"usb_storage"
"sd_mod"
"sr_mod"
"rtsx_pci_sdmmc"
];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
boot = {
initrd = {
availableKernelModules = [
"xhci_pci"
"ehci_pci"
"ahci"
"usb_storage"
"sd_mod"
"sr_mod"
"rtsx_pci_sdmmc"
];
kernelModules = [];
};
fileSystems."/persist" = {neededForBoot = true;};
extraModulePackages = [];
kernelModules = ["kvm-intel"];
};
# Otherwise, CPU doesn't automatically clock down.
powerManagement.cpuFreqGovernor = "ondemand";
# Intel drivers with accelerated video playback support.
nixpkgs.config.packageOverrides = pkgs: {
intel-vaapi-driver =
pkgs.intel-vaapi-driver.override {enableHybridCodec = true;};
};
nixpkgs = {
config.packageOverrides = pkgs: {
# Intel drivers with accelerated video playback support.
intel-vaapi-driver =
pkgs.intel-vaapi-driver.override {enableHybridCodec = true;};
};
hardware.opengl = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver # LIBVA_DRIVER_NAME=iHD
intel-vaapi-driver # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
libvdpau-va-gl
];
hostPlatform = lib.mkDefault "x86_64-linux";
};
hardware = {
cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
enableAllFirmware = true;
opengl = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver # LIBVA_DRIVER_NAME=iHD
intel-vaapi-driver # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
libvdpau-va-gl
];
};
};
environment.sessionVariables = {
LIBVA_DRIVER_NAME = "iHD";
}; # Force intel-media-driver
LIBVA_DRIVER_NAME = "iHD"; # Force intel-media-driver
};
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
}