summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorSimon Parri <simonparri@ganzeria.com>2025-06-17 01:54:11 -0500
committerSimon Parri <simonparri@ganzeria.com>2025-06-17 02:03:35 -0500
commit9e70a1fd74cadc169f45f16dd0a05409468be70b (patch)
tree416f365c2cf5d27f4260ff1a9780cc9c82d584f0 /modules
parent174aeddd2f10d48c87977446aad01323f1a82ef4 (diff)
downloadnixos-config-9e70a1fd74cadc169f45f16dd0a05409468be70b.tar.gz
nixos-config-9e70a1fd74cadc169f45f16dd0a05409468be70b.zip
modules/zcfan: Add and use on tomato
Diffstat (limited to 'modules')
-rw-r--r--modules/default.nix1
-rw-r--r--modules/zcfan.nix25
2 files changed, 26 insertions, 0 deletions
diff --git a/modules/default.nix b/modules/default.nix
index 54af441..243b152 100644
--- a/modules/default.nix
+++ b/modules/default.nix
@@ -4,6 +4,7 @@
imports = [
./gui.nix
./laptop.nix
+ ./zcfan.nix
./locales.nix
./envfs.nix
./pc.nix
diff --git a/modules/zcfan.nix b/modules/zcfan.nix
new file mode 100644
index 0000000..d26c07d
--- /dev/null
+++ b/modules/zcfan.nix
@@ -0,0 +1,25 @@
+{ 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 ];
+ };
+}