letting it auto run pretty much, god i don't know how to program anymore. This is kinda a joke
This commit is contained in:
35
modules/hardware/amd.nix
Normal file
35
modules/hardware/amd.nix
Normal file
@@ -0,0 +1,35 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
options.hardware.amd.enable = mkEnableOption "AMD graphics support";
|
||||
|
||||
config = mkIf config.hardware.amd.enable {
|
||||
# AMD driver configuration
|
||||
services.xserver.videoDrivers = [ "amdgpu" ];
|
||||
|
||||
# Enable AMD GPU support
|
||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||
|
||||
# AMD specific packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
radeontop
|
||||
nvtopPackages.amd
|
||||
];
|
||||
|
||||
# OpenGL packages for AMD
|
||||
hardware.opengl.extraPackages = with pkgs; [
|
||||
amdvlk
|
||||
rocm-opencl-icd
|
||||
rocm-opencl-runtime
|
||||
];
|
||||
|
||||
hardware.opengl.extraPackages32 = with pkgs.pkgsi686Linux; [
|
||||
driversi686Linux.amdvlk
|
||||
];
|
||||
|
||||
# AMD GPU firmware
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
};
|
||||
}
|
||||
42
modules/hardware/audio.nix
Normal file
42
modules/hardware/audio.nix
Normal file
@@ -0,0 +1,42 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
options.hardware.audio.pipewire.enable = mkEnableOption "PipeWire audio system";
|
||||
|
||||
config = mkIf config.hardware.audio.pipewire.enable {
|
||||
# PipeWire configuration
|
||||
security.rtkit.enable = true;
|
||||
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
jack.enable = true;
|
||||
};
|
||||
|
||||
# Audio packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Audio control
|
||||
pavucontrol
|
||||
pulsemixer
|
||||
alsamixer
|
||||
|
||||
# Audio tools
|
||||
audacity
|
||||
pulseaudio
|
||||
|
||||
# Bluetooth audio
|
||||
bluez
|
||||
bluez-tools
|
||||
];
|
||||
|
||||
# Disable PulseAudio (conflicts with PipeWire)
|
||||
hardware.pulseaudio.enable = false;
|
||||
|
||||
# Audio group for user
|
||||
users.groups.audio = {};
|
||||
};
|
||||
}
|
||||
45
modules/hardware/bluetooth.nix
Normal file
45
modules/hardware/bluetooth.nix
Normal file
@@ -0,0 +1,45 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
options.hardware.bluetooth.enhanced.enable = mkEnableOption "Enhanced Bluetooth support";
|
||||
|
||||
config = mkIf config.hardware.bluetooth.enhanced.enable {
|
||||
# Enable Bluetooth
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
powerOnBoot = true;
|
||||
settings = {
|
||||
General = {
|
||||
Enable = "Source,Sink,Media,Socket";
|
||||
Experimental = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Bluetooth services
|
||||
services.blueman.enable = true;
|
||||
|
||||
# Bluetooth packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
bluez
|
||||
bluez-tools
|
||||
blueman
|
||||
bluetuith
|
||||
];
|
||||
|
||||
# Auto-connect trusted devices
|
||||
systemd.user.services.bluetooth-auto-connect = {
|
||||
description = "Auto-connect Bluetooth devices";
|
||||
after = [ "bluetooth.service" ];
|
||||
partOf = [ "bluetooth.service" ];
|
||||
serviceConfig = {
|
||||
Type = "forking";
|
||||
ExecStart = "${pkgs.bluez}/bin/bluetoothctl connect-all";
|
||||
RemainAfterExit = true;
|
||||
};
|
||||
wantedBy = [ "default.target" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -14,8 +14,7 @@ with lib;
|
||||
|
||||
# Common hardware support
|
||||
hardware = {
|
||||
# Enable all firmware
|
||||
enableAllFirmware = true;
|
||||
# Enable redistributable firmware only
|
||||
enableRedistributableFirmware = true;
|
||||
|
||||
# CPU microcode updates
|
||||
@@ -25,8 +24,6 @@ with lib;
|
||||
# OpenGL/Graphics
|
||||
opengl = {
|
||||
enable = true;
|
||||
driSupport = true;
|
||||
driSupport32Bit = true;
|
||||
|
||||
# Common OpenGL packages
|
||||
extraPackages = with pkgs; [
|
||||
@@ -50,8 +47,16 @@ with lib;
|
||||
# Sensor support (for laptops)
|
||||
sensor.iio.enable = true;
|
||||
|
||||
# Firmware updater
|
||||
fwupd.enable = true;
|
||||
# Scanner support
|
||||
sane = {
|
||||
enable = true;
|
||||
extraBackends = with pkgs; [
|
||||
sane-airscan
|
||||
epkowa
|
||||
];
|
||||
};
|
||||
|
||||
# Firmware updater (moved to services section)
|
||||
};
|
||||
|
||||
# Kernel modules
|
||||
@@ -80,8 +85,6 @@ with lib;
|
||||
# Power profiles daemon (modern power management)
|
||||
power-profiles-daemon.enable = true;
|
||||
|
||||
# Firmware update service
|
||||
fwupd.enable = true;
|
||||
|
||||
# Hardware monitoring
|
||||
smartd = {
|
||||
@@ -112,11 +115,9 @@ with lib;
|
||||
hwinfo
|
||||
inxi
|
||||
dmidecode
|
||||
lscpu
|
||||
lsusb
|
||||
lspci
|
||||
pciutils
|
||||
usbutils
|
||||
util-linux # provides lscpu
|
||||
pciutils # provides lspci
|
||||
usbutils # provides lsusb
|
||||
|
||||
# Disk tools
|
||||
smartmontools
|
||||
@@ -164,7 +165,7 @@ with lib;
|
||||
# Virtual console configuration
|
||||
console = {
|
||||
earlySetup = true;
|
||||
font = "${pkgs.terminus_font}/share/consolefonts/ter-132n.psf.gz";
|
||||
font = lib.mkDefault "${pkgs.terminus_font}/share/consolefonts/ter-132n.psf.gz";
|
||||
packages = [ pkgs.terminus_font ];
|
||||
};
|
||||
}
|
||||
39
modules/hardware/intel.nix
Normal file
39
modules/hardware/intel.nix
Normal file
@@ -0,0 +1,39 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
options.hardware.intel.enable = mkEnableOption "Intel graphics support";
|
||||
|
||||
config = mkIf config.hardware.intel.enable {
|
||||
# Intel driver configuration
|
||||
services.xserver.videoDrivers = [ "modesetting" ];
|
||||
|
||||
# Enable Intel GPU support
|
||||
boot.initrd.kernelModules = [ "i915" ];
|
||||
|
||||
# Intel GPU early loading
|
||||
boot.kernelParams = [ "i915.enable_guc=2" ];
|
||||
|
||||
# Intel specific packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
intel-gpu-tools
|
||||
nvtopPackages.intel
|
||||
];
|
||||
|
||||
# OpenGL packages for Intel (already configured in default.nix)
|
||||
hardware.opengl.extraPackages = with pkgs; [
|
||||
intel-media-driver
|
||||
vaapiIntel
|
||||
intel-compute-runtime
|
||||
intel-ocl
|
||||
];
|
||||
|
||||
hardware.opengl.extraPackages32 = with pkgs.pkgsi686Linux; [
|
||||
vaapiIntel
|
||||
];
|
||||
|
||||
# Intel GPU power management
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
||||
};
|
||||
}
|
||||
35
modules/hardware/nvidia.nix
Normal file
35
modules/hardware/nvidia.nix
Normal file
@@ -0,0 +1,35 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
options.hardware.nvidia.enable = mkEnableOption "NVIDIA graphics support";
|
||||
|
||||
config = mkIf config.hardware.nvidia.enable {
|
||||
# NVIDIA driver configuration
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true;
|
||||
powerManagement.enable = false;
|
||||
powerManagement.finegrained = false;
|
||||
open = false;
|
||||
nvidiaSettings = true;
|
||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
};
|
||||
|
||||
# NVIDIA specific packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
nvidia-vaapi-driver
|
||||
libva-utils
|
||||
nvtopPackages.nvidia
|
||||
];
|
||||
|
||||
# OpenGL packages for NVIDIA
|
||||
hardware.opengl.extraPackages = with pkgs; [
|
||||
nvidia-vaapi-driver
|
||||
vaapiVdpau
|
||||
libvdpau-va-gl
|
||||
];
|
||||
};
|
||||
}
|
||||
45
modules/hardware/touchpad.nix
Normal file
45
modules/hardware/touchpad.nix
Normal file
@@ -0,0 +1,45 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
options.hardware.touchpad.enable = mkEnableOption "Enhanced touchpad support";
|
||||
|
||||
config = mkIf config.hardware.touchpad.enable {
|
||||
# Touchpad support via libinput
|
||||
services.xserver.libinput = {
|
||||
enable = true;
|
||||
touchpad = {
|
||||
tapping = true;
|
||||
tappingDragLock = true;
|
||||
naturalScrolling = true;
|
||||
scrollMethod = "twofinger";
|
||||
disableWhileTyping = true;
|
||||
middleEmulation = true;
|
||||
accelProfile = "adaptive";
|
||||
};
|
||||
};
|
||||
|
||||
# Synaptics touchpad (alternative, disabled by default)
|
||||
services.xserver.synaptics = {
|
||||
enable = false;
|
||||
twoFingerScroll = true;
|
||||
palmDetect = true;
|
||||
tapButtons = true;
|
||||
buttonsMap = [ 1 3 2 ];
|
||||
fingersMap = [ 0 0 0 ];
|
||||
};
|
||||
|
||||
# Touchpad packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
libinput
|
||||
xinput
|
||||
xorg.xf86inputlibinput
|
||||
];
|
||||
|
||||
# Touchpad gesture support
|
||||
services.touchegg = {
|
||||
enable = false; # Disabled by default, enable if needed
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user