From ea873305c860dccb31f99d40ae3264506b7707ab Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Sun, 19 Mar 2023 16:01:30 +0100 Subject: [PATCH] hardware/debug: migrate from legacy --- legacy/modules/hardware-base.nix | 10 --------- machines/thinkman/hardware-configuration.nix | 1 + modules/hardware/debug/default.nix | 22 ++++++++++++++++++++ modules/hardware/default.nix | 1 + 4 files changed, 24 insertions(+), 10 deletions(-) create mode 100644 modules/hardware/debug/default.nix diff --git a/legacy/modules/hardware-base.nix b/legacy/modules/hardware-base.nix index 692160d..9c040f3 100644 --- a/legacy/modules/hardware-base.nix +++ b/legacy/modules/hardware-base.nix @@ -2,14 +2,4 @@ { services.smartd.enable = true; - environment.systemPackages = with pkgs; [ - dmidecode - f3 - hdparm - lm_sensors - nvme-cli - pciutils - smartmontools - testdisk - ]; } diff --git a/machines/thinkman/hardware-configuration.nix b/machines/thinkman/hardware-configuration.nix index 667fb3c..d0b2239 100644 --- a/machines/thinkman/hardware-configuration.nix +++ b/machines/thinkman/hardware-configuration.nix @@ -11,6 +11,7 @@ in my.hardware = { bluetooth.enable = true; + debug.enable = true; firmware = { enable = true; cpuFlavor = cpuFlavor; diff --git a/modules/hardware/debug/default.nix b/modules/hardware/debug/default.nix new file mode 100644 index 0000000..9c55232 --- /dev/null +++ b/modules/hardware/debug/default.nix @@ -0,0 +1,22 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.my.hardware.debug; +in +{ + options.my.hardware.debug = with lib; { + enable = mkEnableOption "hardware-debug configuration"; + }; + + config = lib.mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + dmidecode + f3 + hdparm + lm_sensors + nvme-cli + pciutils + smartmontools + testdisk + ]; + }; +} diff --git a/modules/hardware/default.nix b/modules/hardware/default.nix index dd04582..15c047c 100644 --- a/modules/hardware/default.nix +++ b/modules/hardware/default.nix @@ -4,6 +4,7 @@ { imports = [ ./bluetooth + ./debug ./firmware ./graphics ./keychron