moved base hardware cofnig + sound to hardwareModules

This commit is contained in:
Aly Raffauf 2024-06-26 23:57:41 -04:00
parent 84e1f6cf34
commit 05d7747a9e
12 changed files with 65 additions and 39 deletions

View file

@ -10,5 +10,27 @@ inputs: {
./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

@ -7,15 +7,20 @@
...
}: {
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,11 +1,12 @@
{
config,
inputs,
lib,
pkgs,
...
}: {
config = lib.mkIf config.ar.base.enable {
config = lib.mkIf config.ar.hardware.ssd {
sound.enable = true;
hardware.pulseaudio = {
enable = lib.mkForce false;
package = pkgs.pulseaudioFull;
@ -14,14 +15,14 @@
services = {
pipewire = {
enable = true;
alsa = {
enable = true;
support32Bit = true;
};
pulse.enable = true;
};
};
sound.enable = true;
};
}

View file

@ -47,9 +47,11 @@
};
ar.hardware = {
enable = true;
cpu.intel = true;
gpu.intel = true;
laptop = true;
ssd = true;
sound = true;
};
}

View file

@ -34,9 +34,11 @@
};
ar.hardware = {
enable = true;
cpu.amd = true;
gpu.amd = true;
laptop = true;
ssd = true;
sound = true;
};
}

View file

@ -14,9 +14,11 @@
hardware.enableAllFirmware = true;
ar.hardware = {
enable = true;
cpu.amd = true;
gpu.amd = true;
laptop = false;
ssd = true;
sound = true;
};
}

View file

@ -10,9 +10,11 @@
hardware.enableAllFirmware = true;
ar.hardware = {
enable = true;
cpu.amd = true;
gpu.amd = true;
laptop = false;
ssd = true;
sound = true;
};
}

View file

@ -17,9 +17,11 @@
};
ar.hardware = {
enable = true;
cpu.intel = true;
gpu.intel = true;
laptop = true;
ssd = true;
sound = true;
};
}

View file

@ -36,9 +36,11 @@
services.fwupd.enable = true;
ar.hardware = {
enable = true;
cpu.intel = true;
gpu.intel = true;
laptop = true;
ssd = true;
sound = true;
};
}

View file

@ -5,16 +5,13 @@
...
}: {
config = lib.mkIf config.ar.apps.steam.enable {
hardware.steam-hardware.enable = true;
programs = {
gamescope.enable = config.ar.desktop.steam.enable;
steam = {
enable = true;
dedicatedServer.openFirewall = true;
extraCompatPackages = with pkgs; [
proton-ge-bin
];
extraCompatPackages = with pkgs; [proton-ge-bin];
gamescopeSession.enable = config.ar.desktop.steam.enable;
localNetworkGameTransfers.openFirewall = true;
remotePlay.openFirewall = true;

View file

@ -10,7 +10,6 @@
./nix
./nixpkgs
./plymouth
./sound
./zramSwap
];
@ -63,23 +62,6 @@
enableSSHSupport = true;
};
hardware = {
# Add support for logitech unifying receivers.
logitech.wireless = {
enable = true;
enableGraphical = true;
};
keyboard.qmk.enable = true;
};
services = {
logind.extraConfig = ''
# Don't shutdown when power button is short-pressed
HandlePowerKey=suspend
HandlePowerKeyLongPress=poweroff
'';
};
security = {
polkit.enable = true;
rtkit.enable = true;

View file

@ -9,17 +9,12 @@
config = lib.mkIf config.ar.base.enable {
age.secrets.wifi.file = ../../../secrets/wifi.age;
hardware = {
bluetooth.enable = true;
};
networking.networkmanager = {
enable = true;
ensureProfiles = {
environmentFiles = [
config.age.secrets.wifi.path
];
environmentFiles = [config.age.secrets.wifi.path];
profiles = {
"Dustin's A54" = {
connection = {
@ -27,12 +22,14 @@
type = "wifi";
uuid = "fc221cbd-b6fd-44e0-8679-5998933b2fff";
};
wifi.ssid = "Dustin's A54";
wifi-security = {
auth-alg = "open";
key-mgmt = "wpa-psk";
psk = "$DustinsA54PSK";
};
wifi.ssid = "Dustin's A54";
};
javapatron = {
@ -41,11 +38,13 @@
type = "wifi";
uuid = "bb61beaa-ec07-404c-bbce-5a08ae355de7";
};
wifi.ssid = "javapatron";
wifi-security = {
auth-alg = "open";
key-mgmt = "wpa-psk";
};
wifi.ssid = "javapatron";
};
"Taproom Public WiFi" = {
@ -54,11 +53,13 @@
type = "wifi";
uuid = "d79280e9-4a22-4125-9583-eb7b80abfeb6";
};
wifi.ssid = "Taproom Public WiFi";
wifi-security = {
auth-alg = "open";
key-mgmt = "wpa-psk";
};
wifi.ssid = "Taproom Public WiFi";
};
Stargate-Discovery = {
@ -66,12 +67,14 @@
id = "Stargate-Discovery";
type = "wifi";
};
wifi.ssid = "Stargate-Discovery";
wifi-security = {
auth-alg = "open";
key-mgmt = "wpa-psk";
psk = "$StargateDiscoveryPSK";
};
wifi.ssid = "Stargate-Discovery";
};
wallace = {
@ -80,12 +83,14 @@
type = "wifi";
uuid = "6896b13d-9717-4a8d-8a08-2a97139bf833";
};
wifi.ssid = "wallace";
wifi-security = {
auth-alg = "open";
key-mgmt = "wpa-psk";
psk = "$wallacePSK";
};
wifi.ssid = "wallace";
};
WeWorkWiFi = {
@ -95,12 +100,14 @@
password = "$WeWorkWiFiPassword";
phase2-auth = "mschapv2";
};
connection = {
id = "WeWorkWiFi";
type = "wifi";
};
wifi.ssid = "WeWorkWiFi";
wifi-security.key-mgmt = "wpa-eap";
wifi.ssid = "WeWorkWiFi";
};
};
};