From 19415ddf40346623ce00ec58cdd3177c26d440ae Mon Sep 17 00:00:00 2001 From: Erwin Boskma Date: Wed, 23 Oct 2024 16:24:05 +0200 Subject: [PATCH] waybar: Add profile option --- home-manager/modules/waybar/default.nix | 12 +++++++++++- users/erwin/work.nix | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/home-manager/modules/waybar/default.nix b/home-manager/modules/waybar/default.nix index d5cade9..5f6495f 100644 --- a/home-manager/modules/waybar/default.nix +++ b/home-manager/modules/waybar/default.nix @@ -13,6 +13,14 @@ in enable = mkEnableOption "Enable waybar"; sway = mkEnableOption "sway"; river = mkEnableOption "river"; + profile = mkOption { + description = ""; + type = types.enum [ + "home" + "work" + ]; + default = "home"; + }; cpuTempPath = mkOption { description = "The path to the CPU temperature sensor in sysfs"; @@ -41,8 +49,10 @@ in "sway/workspaces" "sway/mode" ] - ++ [ "custom/now_playing" ]; + ++ lib.optional (cfg.profile == "home") "custom/now_playing"; + modules-center = (lib.optional cfg.sway "sway/window") ++ (lib.optional cfg.river "river/window"); + modules-right = [ "network" "memory" diff --git a/users/erwin/work.nix b/users/erwin/work.nix index 2be9d25..560b6cb 100644 --- a/users/erwin/work.nix +++ b/users/erwin/work.nix @@ -167,6 +167,7 @@ in waybar = { enable = true; sway = true; + profile = "work"; cpuTempPath = "/sys/class/hwmon/hwmon1/temp2_input"; }; };