summaryrefslogtreecommitdiff
path: root/modules/hardware
diff options
context:
space:
mode:
Diffstat (limited to 'modules/hardware')
-rw-r--r--modules/hardware/bluetooth.nix2
-rw-r--r--modules/hardware/cpu.nix26
-rw-r--r--modules/hardware/default.nix7
-rw-r--r--modules/hardware/graphics.nix19
-rw-r--r--modules/hardware/nvidia.nix19
-rw-r--r--modules/hardware/tpm.nix18
-rw-r--r--modules/hardware/usb.nix10
-rw-r--r--modules/hardware/yubikey.nix23
8 files changed, 83 insertions, 41 deletions
diff --git a/modules/hardware/bluetooth.nix b/modules/hardware/bluetooth.nix
index ede4f77..8400a72 100644
--- a/modules/hardware/bluetooth.nix
+++ b/modules/hardware/bluetooth.nix
@@ -1,5 +1,7 @@
{ pkgs, ... }:
{
+ boot.kernelParams = [ "btusb" ];
+
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
diff --git a/modules/hardware/cpu.nix b/modules/hardware/cpu.nix
new file mode 100644
index 0000000..b57190a
--- /dev/null
+++ b/modules/hardware/cpu.nix
@@ -0,0 +1,26 @@
+{
+ pkgs,
+ config,
+ ...
+}:
+{
+ hardware.cpu.amd.updateMicrocode = true;
+ environment.systemPackages = [ pkgs.amdctl ];
+
+ powerManagement = {
+ enable = true;
+ cpuFreqGovernor = "performance";
+ };
+
+ boot = {
+ kernelModules = [
+ # "kvm-amd"
+ "amd-pstate"
+ "zenpower"
+ "msr"
+ ];
+
+ kernelParams = [ "amd_iommu=on" ];
+ extraModulePackages = [ config.boot.kernelPackages.zenpower ];
+ };
+}
diff --git a/modules/hardware/default.nix b/modules/hardware/default.nix
index 4c413a0..167e7c7 100644
--- a/modules/hardware/default.nix
+++ b/modules/hardware/default.nix
@@ -1,13 +1,14 @@
{
imports = [
+ ./cpu.nix
./bluetooth.nix
- ./graphics.nix
- ./nvidia.nix
+ ./usb.nix
+ ./tpm.nix
+ ./yubikey.nix
];
hardware = {
enableRedistributableFirmware = true;
enableAllFirmware = true;
- cpu.amd.updateMicrocode = true;
};
}
diff --git a/modules/hardware/graphics.nix b/modules/hardware/graphics.nix
deleted file mode 100644
index 0e01517..0000000
--- a/modules/hardware/graphics.nix
+++ /dev/null
@@ -1,19 +0,0 @@
-{ pkgs, ... }:
-{
- hardware.graphics = {
- enable = true;
- enable32Bit = true;
-
- extraPackages = with pkgs; [
- nvidia-vaapi-driver
- vaapiVdpau
- libvdpau-va-gl
- ];
-
- extraPackages32 = with pkgs; [
- nvidia-vaapi-driver
- vaapiVdpau
- libvdpau-va-gl
- ];
- };
-}
diff --git a/modules/hardware/nvidia.nix b/modules/hardware/nvidia.nix
deleted file mode 100644
index 31e2100..0000000
--- a/modules/hardware/nvidia.nix
+++ /dev/null
@@ -1,19 +0,0 @@
-{ config, ... }:
-{
- hardware = {
- nvidia-container-toolkit.enable = true;
-
- nvidia = {
- modesetting.enable = true;
- open = false;
- nvidiaSettings = true;
- package = config.boot.kernelPackages.nvidiaPackages.production;
- forceFullCompositionPipeline = true;
-
- powerManagement = {
- enable = true;
- finegrained = false;
- };
- };
- };
-}
diff --git a/modules/hardware/tpm.nix b/modules/hardware/tpm.nix
new file mode 100644
index 0000000..b84551e
--- /dev/null
+++ b/modules/hardware/tpm.nix
@@ -0,0 +1,18 @@
+{ pkgs, ... }:
+{
+ security.tpm2 = {
+ enable = true;
+ applyUdevRules = true;
+ abrmd.enable = true;
+ tctiEnvironment.enable = true;
+ pkcs11.enable = true;
+ };
+
+ environment.systemPackages = with pkgs; [
+ tpm2-tools
+ tpm2-tss
+ tpm2-abrmd
+ ];
+
+ boot.kernelModules = [ "uhid" ];
+}
diff --git a/modules/hardware/usb.nix b/modules/hardware/usb.nix
new file mode 100644
index 0000000..f697761
--- /dev/null
+++ b/modules/hardware/usb.nix
@@ -0,0 +1,10 @@
+{ pkgs, ... }:
+{
+ environment.systemPackages = with pkgs; [
+ usbutils
+ lm_sensors
+ pciutils
+ ];
+
+ boot.kernelParams = [ "usbcore.autosuspend=-1" ];
+}
diff --git a/modules/hardware/yubikey.nix b/modules/hardware/yubikey.nix
new file mode 100644
index 0000000..87633ac
--- /dev/null
+++ b/modules/hardware/yubikey.nix
@@ -0,0 +1,23 @@
+{
+ config,
+ pkgs,
+ lib,
+ ...
+}:
+{
+ hardware.gpgSmartcards.enable = true;
+
+ services = {
+ pcscd.enable = true;
+ udev.packages = [ pkgs.yubikey-personalization ];
+ };
+
+ environment.systemPackages = with pkgs; [
+ yubikey-manager
+ yubikey-manager-qt
+ yubikey-personalization
+ yubikey-personalization-gui
+ yubico-piv-tool
+ yubioath-flutter
+ ];
+}