From be1e31bb78d52a96961065269ece2fccac58075e Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Fri, 23 Jul 2021 19:18:07 +0200 Subject: [PATCH] home: i3bar: make temp display configurable --- home/x/i3bar.nix | 19 +++++++++++++++---- hosts/boreal/home.nix | 2 ++ hosts/zephyrus/home.nix | 2 ++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/home/x/i3bar.nix b/home/x/i3bar.nix index 2f8b4c8..dadde9b 100644 --- a/home/x/i3bar.nix +++ b/home/x/i3bar.nix @@ -2,8 +2,21 @@ let isEnabled = config.my.home.x.enable; i3BarTheme = config.my.theme.i3BarTheme; + cfg = config.my.home.x.i3bar; in { + options.my.home.x.i3bar = with lib; { + temperature.chip = mkOption { + type = types.str; + example = "coretemp-isa-*"; + default = ""; + }; + temperature.inputs = mkOption { + type = types.listOf types.str; + example = ["Core 0" "Core 1" "Core 2" "Core 3"]; + default = ""; + }; + }; config = lib.mkIf isEnabled { home.packages = with pkgs; [ @@ -57,10 +70,8 @@ in collapsed = false; interval = 10; format = "{max}"; - # FIXME: specific to my AMD Ryzen CPU. Make this depend on - # hostname or something else - chip = "k10temp-pci-*"; - inputs = [ "Tccd1" ]; + chip = cfg.temperature.chip; + inputs = cfg.temperature.inputs; } { block = "networkmanager"; diff --git a/hosts/boreal/home.nix b/hosts/boreal/home.nix index f1e3ec8..006cb4a 100644 --- a/hosts/boreal/home.nix +++ b/hosts/boreal/home.nix @@ -3,6 +3,8 @@ home-manager.users.alarsyo = { # Keyboard settings & i3 settings my.home.x.enable = true; + my.home.x.i3bar.temperature.chip = "k10temp-pci-*"; + my.home.x.i3bar.temperature.inputs = [ "Tccd1" ]; my.home.x.cursor.enable = true; my.home.alacritty.enable = true; my.home.emacs.enable = true; diff --git a/hosts/zephyrus/home.nix b/hosts/zephyrus/home.nix index 08f11ad..806dff4 100644 --- a/hosts/zephyrus/home.nix +++ b/hosts/zephyrus/home.nix @@ -3,6 +3,8 @@ home-manager.users.alarsyo = { # Keyboard settings & i3 settings my.home.x.enable = true; + my.home.x.i3bar.temperature.chip = "coretemp-isa-*"; + my.home.x.i3bar.temperature.inputs = ["Core 0" "Core 1" "Core 2" "Core 3"]; my.home.x.cursor.enable = true; my.home.alacritty.enable = true; my.home.emacs.enable = true;