From 160952445acbf78679688786163e1e2421412584 Mon Sep 17 00:00:00 2001 From: fleaz Date: Thu, 4 Apr 2024 21:22:58 +0200 Subject: [PATCH] Add my.isLaptop variable --- customOptions.nix | 26 +++++++++++++++++--------- home-manager/default.nix | 5 ++--- machines/smithers/configuration.nix | 3 +++ overlay | 2 +- 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/customOptions.nix b/customOptions.nix index 9e8f259..577e69b 100644 --- a/customOptions.nix +++ b/customOptions.nix @@ -1,14 +1,22 @@ {lib,...}:{ -options.my.highDPI = lib.mkOption { - description = "If the device has a high DPI screen"; - default = true; - type = lib.types.bool; - }; + options.my = { + highDPI = lib.mkOption { + description = "If the device has a high DPI screen"; + default = true; + type = lib.types.bool; + }; -options.my.includeTLP = lib.mkOption { - description = "If the device should get TLP"; - default = true; - type = lib.types.bool; + includeTLP = lib.mkOption { + description = "If the device should get TLP"; + default = true; + type = lib.types.bool; + }; + + isLaptop = lib.mkOption { + description = "If the device is a laptop"; + default = false; + type = lib.types.bool; + }; }; } diff --git a/home-manager/default.nix b/home-manager/default.nix index 2c6c540..390cdd2 100644 --- a/home-manager/default.nix +++ b/home-manager/default.nix @@ -120,11 +120,10 @@ in studio-link python3.pkgs.brother-ql - ] ++ lib.optionals (config.networking.hostName == "jimbo") [ - networkmanager - ] ++ lib.optionals (config.networking.hostName == "milhouse") [ + ] ++ lib.optionals (config.my.isLaptop) [ networkmanager ]; + home.stateVersion = "21.11"; gtk = { diff --git a/machines/smithers/configuration.nix b/machines/smithers/configuration.nix index 443b47c..15ead57 100644 --- a/machines/smithers/configuration.nix +++ b/machines/smithers/configuration.nix @@ -14,6 +14,9 @@ # disable the include of TLP because we get the fancy AMD one from nixos-hardwware my.includeTLP = false; + # Smithers is a laptop + my.isLaptop = true; + # Don't wake from sleep if plugged into AC hardware.framework.amd-7040.preventWakeOnAC = true; diff --git a/overlay b/overlay index 8394729..87e0026 160000 --- a/overlay +++ b/overlay @@ -1 +1 @@ -Subproject commit 83947293966a99621d28fdfe05dd92ca33528574 +Subproject commit 87e002697a0bb6883824f1ce8395a67638c6fb49