summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorSimon Parri <simonparri@ganzeria.com>2025-06-17 02:18:39 -0500
committerSimon Parri <simonparri@ganzeria.com>2025-06-17 03:00:11 -0500
commita02ab9b9364f9212c0d5d2c27b49793f6f3bc0bb (patch)
treeb1f76ffd7b8cb43a8281f8e624d06d3474a9e96d /modules
parent9e70a1fd74cadc169f45f16dd0a05409468be70b (diff)
downloadnixos-config-a02ab9b9364f9212c0d5d2c27b49793f6f3bc0bb.tar.gz
nixos-config-a02ab9b9364f9212c0d5d2c27b49793f6f3bc0bb.zip
modules/zcfan -> modules/thinkpad
Diffstat (limited to 'modules')
-rw-r--r--modules/default.nix2
-rw-r--r--modules/thinkpad.nix32
-rw-r--r--modules/zcfan.nix25
3 files changed, 33 insertions, 26 deletions
diff --git a/modules/default.nix b/modules/default.nix
index 243b152..5e2e17b 100644
--- a/modules/default.nix
+++ b/modules/default.nix
@@ -4,7 +4,7 @@
imports = [
./gui.nix
./laptop.nix
- ./zcfan.nix
+ ./thinkpad.nix
./locales.nix
./envfs.nix
./pc.nix
diff --git a/modules/thinkpad.nix b/modules/thinkpad.nix
new file mode 100644
index 0000000..00ccfbb
--- /dev/null
+++ b/modules/thinkpad.nix
@@ -0,0 +1,32 @@
+{ lib, config, pkgs, ... }:
+
+let cfg = config.this.laptop.thinkpad;
+ mkZcfanConf = c: lib.generators.toKeyValue {
+ mkKeyValue = lib.generators.mkKeyValueDefault {} " ";
+ } c;
+ zcfanConf = mkZcfanConf cfg.zcfan.settings;
+in
+{
+ options = {
+ this.laptop.thinkpad = {
+ enable = lib.mkEnableOption "thinkpad settings";
+ zcfan = {
+ settings = lib.mkOption {
+ type = with lib.types;
+ attrsOf (oneOf [int str]);
+ default = { };
+ description = "Settings for zcfan.";
+ };
+ };
+ };
+ };
+
+ config = lib.mkIf cfg.enable {
+ boot.extraModprobeConfig = "options thinkpad_acpi fan_control=1";
+
+ environment.etc."zcfan.conf" = lib.mkIf (zcfanConf != "") { text = zcfanConf; };
+ environment.systemPackages = [ pkgs.zcfan ];
+ systemd.packages = [ pkgs.zcfan ];
+ systemd.services.zcfan.wantedBy = [ "multi-user.target" ];
+ };
+}
diff --git a/modules/zcfan.nix b/modules/zcfan.nix
deleted file mode 100644
index d26c07d..0000000
--- a/modules/zcfan.nix
+++ /dev/null
@@ -1,25 +0,0 @@
-{ lib, config, pkgs, ... }:
-
-let cfg = config.this.laptop.zcfan;
- mkConf = c: lib.generators.toKeyValue {
- mkKeyValue = lib.generators.mkKeyValueDefault {} " ";
- } c;
- conf = mkConf cfg.settings;
-in
-{
- options = {
- this.laptop.zcfan.enable = lib.mkEnableOption "zcfan";
- this.laptop.zcfan.settings = lib.mkOption {
- type = with lib.types;
- attrsOf (oneOf [int str]);
- default = { };
- description = "Settings for zcfan.";
- };
- };
-
- config = lib.mkIf cfg.enable {
- environment.etc."zcfan.conf" = lib.mkIf (conf != "") { text = conf; };
- environment.systemPackages = [ pkgs.zcfan ];
- systemd.packages = [ pkgs.zcfan ];
- };
-}