From 5eb5fa2d9c8dadc991df0d1d157f43916fd181ee Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Wed, 20 Jul 2022 23:44:43 -0400 Subject: fix(grfn/home): Don't display battery for ogopogo there isn't one Change-Id: I154e1d6a7a3ae1f87242209a175ef32dc43eefe4 Reviewed-on: https://cl.tvl.fyi/c/depot/+/5964 Reviewed-by: grfn Autosubmit: grfn Tested-by: BuildkiteCI --- users/grfn/system/home/machines/ogopogo.nix | 1 + users/grfn/system/home/modules/i3.nix | 34 +++++++++++++++++++---------- 2 files changed, 23 insertions(+), 12 deletions(-) (limited to 'users/grfn') diff --git a/users/grfn/system/home/machines/ogopogo.nix b/users/grfn/system/home/machines/ogopogo.nix index 19d3a54672..e4144e7980 100644 --- a/users/grfn/system/home/machines/ogopogo.nix +++ b/users/grfn/system/home/machines/ogopogo.nix @@ -20,6 +20,7 @@ in system.machine = { wirelessInterface = "wlp4s0"; i3FontSize = 9; + battery = false; }; home.packages = with pkgs; [ diff --git a/users/grfn/system/home/modules/i3.nix b/users/grfn/system/home/modules/i3.nix index c6e198c98a..c9e485006b 100644 --- a/users/grfn/system/home/modules/i3.nix +++ b/users/grfn/system/home/modules/i3.nix @@ -23,18 +23,26 @@ let in { options = with lib; { - system.machine.wirelessInterface = mkOption { - description = '' - Name of the primary wireless interface. Used by i3status, etc. - ''; - default = "wlp3s0"; - type = types.str; - }; + system.machine = { + wirelessInterface = mkOption { + description = '' + Name of the primary wireless interface. Used by i3status, etc. + ''; + default = "wlp3s0"; + type = types.str; + }; - system.machine.i3FontSize = mkOption { - description = "Font size to use in i3 window decorations etc."; - default = 6; - type = types.int; + i3FontSize = mkOption { + description = "Font size to use in i3 window decorations etc."; + default = 6; + type = types.int; + }; + + battery = mkOption { + description = "Does this system have a battery?"; + default = true; + type = types.bool; + }; }; }; @@ -231,7 +239,9 @@ in order += "wireless ${config.system.machine.wirelessInterface}" # order += "ethernet enp3s0f0" order += "cpu_usage" - order += "battery 0" + ${lib.optionalString (config.system.machine.battery) '' + order += "battery 0" + ''} # order += "volume master" order += "time" order += "tztime utc" -- cgit 1.4.1