diff --git a/nix/configuration/hosts/odo/default.nix b/nix/configuration/hosts/odo/default.nix index c3d262d..7708d4e 100644 --- a/nix/configuration/hosts/odo/default.nix +++ b/nix/configuration/hosts/odo/default.nix @@ -56,4 +56,5 @@ me.vnc_client.enable = true; me.vscode.enable = true; me.wasm.enable = true; + me.waybar.enable = true; } diff --git a/nix/configuration/roles/waybar/default.nix b/nix/configuration/roles/waybar/default.nix index d3e714a..ea03b4f 100644 --- a/nix/configuration/roles/waybar/default.nix +++ b/nix/configuration/roles/waybar/default.nix @@ -4,6 +4,7 @@ pkgs, ... }: + let waybar_sway_config = pkgs.writeTextFile { name = "waybar.conf"; @@ -79,38 +80,52 @@ in { imports = [ ]; - environment.systemPackages = with pkgs; [ - waybar - waybar_available_memory - waybar_battery - waybar_clock - waybar_night_mode - waybar_sound - waybar_temperature - python3 # for clock TODO python should not be in the system packages, maybe switch to a venv? ref https://nixos.wiki/wiki/Python - bc # for temperature and sound - jq # for memory, battery, sound, night mode, and temperature - upower # for battery - wlsunset # for night mode - ]; - - me.swayIncludes = [ - waybar_sway_config - ]; - - services.upower.enable = true; # for battery - - home-manager.users.talexander = - { pkgs, ... }: - { - home.file = { - ".config/waybar/config" = { - source = ./files/waybar_config.json; - }; - ".config/waybar/style.css" = { - source = ./files/style.css; - }; - }; + options.me = { + waybar.enable = lib.mkOption { + type = lib.types.bool; + default = false; + example = true; + description = "Whether we want to install waybar."; }; + }; + config = lib.mkIf config.me.waybar.enable ( + lib.mkMerge [ + (lib.mkIf config.me.graphical { + environment.systemPackages = with pkgs; [ + waybar + waybar_available_memory + waybar_battery + waybar_clock + waybar_night_mode + waybar_sound + waybar_temperature + python3 # for clock TODO python should not be in the system packages, maybe switch to a venv? ref https://nixos.wiki/wiki/Python + bc # for temperature and sound + jq # for memory, battery, sound, night mode, and temperature + upower # for battery + wlsunset # for night mode + ]; + + me.swayIncludes = [ + waybar_sway_config + ]; + + services.upower.enable = true; # for battery + + home-manager.users.talexander = + { pkgs, ... }: + { + home.file = { + ".config/waybar/config" = { + source = ./files/waybar_config.json; + }; + ".config/waybar/style.css" = { + source = ./files/style.css; + }; + }; + }; + }) + ] + ); }