remove hardwareModules infavor of upstream nixhw

This commit is contained in:
Aly Raffauf 2024-07-06 18:10:37 -04:00
parent 18c5686d18
commit 90916b08d3
12 changed files with 0 additions and 281 deletions

View file

@ -75,9 +75,6 @@
homeManagerModules.default =
import ./homeManagerModules inputs self;
nixosModules.hardware =
import ./hardwareModules inputs;
nixosModules.nixos =
import ./nixosModules inputs;
@ -102,7 +99,6 @@
inputs.nixvim.nixosModules.nixvim
inputs.nur.nixosModules.nur
inputs.raffauflabs.nixosModules.raffauflabs
self.nixosModules.hardware
self.nixosModules.nixos
{

View file

@ -1,20 +0,0 @@
{
config,
lib,
pkgs,
...
}: {
config = lib.mkIf config.ar.hardware.cpu.amd {
boot = {
kernelModules = ["kvm-amd"];
kernelParams =
lib.optional (config.ar.hardware.laptop) "amd_pstate=active";
};
hardware = {
cpu.amd.updateMicrocode = true;
};
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
};
}

View file

@ -1,12 +0,0 @@
{
config,
inputs,
lib,
pkgs,
...
}: {
imports = [
./amd
./intel
];
}

View file

@ -1,14 +0,0 @@
{
config,
lib,
pkgs,
...
}: {
config = lib.mkIf config.ar.hardware.cpu.intel {
boot.kernelModules = ["kvm-intel"];
hardware.cpu.intel.updateMicrocode = true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.powertop.enable = config.ar.hardware.laptop;
services.thermald.enable = config.ar.hardware.laptop;
};
}

View file

@ -1,36 +0,0 @@
inputs: {
config,
pkgs,
lib,
...
}: {
imports = [
./cpu
./gpu
./laptop
./options.nix
./ssd
./sound
];
config = lib.mkIf config.ar.hardware.enable {
hardware = {
bluetooth.enable = true;
keyboard.qmk.enable = true;
logitech.wireless = {
enable = true;
enableGraphical = true;
};
steam-hardware.enable = config.programs.steam.enable;
};
services.logind.extraConfig = ''
# Don't shutdown when power button is short-pressed
HandlePowerKey=suspend
HandlePowerKeyLongPress=poweroff
'';
};
}

View file

@ -1,28 +0,0 @@
{
config,
lib,
pkgs,
...
}: {
config = lib.mkIf config.ar.hardware.gpu.amd {
boot = {
initrd.kernelModules = ["amdgpu"];
kernelModules = ["amdgpu"];
# Disable AMD Backlight Management.
# ABM severely degrades display quality for miniscule power efficiency gains.
kernelParams = ["amdgpu.abmlevel=0"];
};
hardware.amdgpu = {
initrd.enable = true;
amdvlk = {
enable = true;
support32Bit.enable = true;
};
opencl.enable = true;
};
};
}

View file

@ -1,12 +0,0 @@
{
config,
inputs,
lib,
pkgs,
...
}: {
imports = [
./amd
./intel
];
}

View file

@ -1,40 +0,0 @@
{
config,
lib,
pkgs,
...
}: {
config = lib.mkIf config.ar.hardware.gpu.intel {
boot.initrd.kernelModules = ["i915"];
environment.sessionVariables = {
LIBVA_DRIVER_NAME = "iHD";
VDPAU_DRIVER = "va_gl";
};
hardware = {
enableAllFirmware = true;
intel-gpu-tools.enable = true;
opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
extraPackages = with pkgs; [
intel-media-driver # LIBVA_DRIVER_NAME=iHD
(intel-vaapi-driver.override {enableHybridCodec = true;})
libvdpau-va-gl
];
extraPackages32 = with pkgs.driversi686Linux; [
intel-media-driver # LIBVA_DRIVER_NAME=iHD
(intel-vaapi-driver.override {enableHybridCodec = true;})
libvdpau-va-gl
];
};
};
services.xserver.videoDrivers = ["modesetting"];
};
}

View file

@ -1,51 +0,0 @@
{
config,
lib,
pkgs,
...
}: let
pp-adjuster = pkgs.writeShellScriptBin "pp-adjuster" ''
current_profile=$(${lib.getExe' pkgs.power-profiles-daemon "powerprofilesctl"} get | tr -d '[:space:]')
if [ "$current_profile" == "power-saver" ]; then
${lib.getExe' pkgs.power-profiles-daemon "powerprofilesctl"} set balanced
elif [ "$current_profile" == "balanced" ]; then
${lib.getExe' pkgs.power-profiles-daemon "powerprofilesctl"} set performance
elif [ "$current_profile" == "performance" ]; then
${lib.getExe' pkgs.power-profiles-daemon "powerprofilesctl"} set power-saver
fi
new_profile=$(${lib.getExe' pkgs.power-profiles-daemon "powerprofilesctl"} get | tr -d '[:space:]')
${lib.getExe pkgs.libnotify} "Power profile set to $new_profile."
'';
in {
config = lib.mkIf config.ar.hardware.laptop {
environment.systemPackages =
lib.optional (config.services.power-profiles-daemon.enable)
pp-adjuster;
services = {
power-profiles-daemon.enable = true;
upower.enable = true;
tlp = {
enable = !config.services.power-profiles-daemon.enable;
settings = {
BAY_POWEROFF_ON_AC = 0;
BAY_POWEROFF_ON_BAT = 1;
CPU_BOOST_ON_AC = 1;
CPU_BOOST_ON_BAT = 0;
CPU_ENERGY_PERF_POLICY_ON_AC = "balance_performance";
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
CPU_HWP_DYN_BOOST_ON_AC = 1;
CPU_HWP_DYN_BOOST_ON_BAT = 0;
PCIE_ASPM_ON_AC = "default";
PCIE_ASPM_ON_BAT = "powersupersave";
PLATFORM_PROFILE_ON_AC = "balanced";
PLATFORM_PROFILE_ON_BAT = "low-power";
RESTORE_DEVICE_STATE_ON_STARTUP = 1;
TLP_DEFAULT_MODE = "AC";
TLP_PERSISTENT_DEFAULT = 0;
};
};
};
};
}

View file

@ -1,26 +0,0 @@
{
config,
inputs,
lib,
pkgs,
self,
...
}: {
options.ar.hardware = {
enable = lib.mkEnableOption "Enable base hardware configuration.";
cpu = {
amd = lib.mkEnableOption "AMD CPU support.";
intel = lib.mkEnableOption "Intel CPU support.";
};
gpu = {
amd = lib.mkEnableOption "AMD GPU support.";
intel = lib.mkEnableOption "Intel GPU support.";
};
laptop = lib.mkEnableOption "Laptop optimizations.";
ssd = lib.mkEnableOption "SSD optimizations.";
sound = lib.mkEnableOption "Sound support.";
};
}

View file

@ -1,28 +0,0 @@
{
config,
lib,
pkgs,
...
}: {
config = lib.mkIf config.ar.hardware.sound {
sound.enable = true;
hardware.pulseaudio = {
enable = lib.mkForce false;
package = pkgs.pulseaudioFull;
};
services = {
pipewire = {
enable = true;
alsa = {
enable = true;
support32Bit = true;
};
pulse.enable = true;
};
};
};
}

View file

@ -1,10 +0,0 @@
{
config,
lib,
pkgs,
...
}: {
config = lib.mkIf config.ar.hardware.ssd {
services.fstrim.enable = true;
};
}