diff --git a/_sources/generated.json b/_sources/generated.json index 84ee881..36155fe 100644 --- a/_sources/generated.json +++ b/_sources/generated.json @@ -659,6 +659,26 @@ }, "version": "2e74ddba0c582b2ca2d9d06f67f5a902c3a093fb" }, + "waybar": { + "cargoLocks": null, + "date": "2024-03-31", + "extract": null, + "name": "waybar", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "catppuccin", + "repo": "waybar", + "rev": "0830796af6aa64ce8bc7453d42876a628777ac68", + "sha256": "sha256-9lY+v1CTbpw2lREG/h65mLLw5KuT8OJdEPOb+NNC6Fo=", + "type": "github" + }, + "version": "0830796af6aa64ce8bc7453d42876a628777ac68" + }, "yazi": { "cargoLocks": null, "date": "2024-02-21", @@ -699,4 +719,4 @@ }, "version": "0adc53028d81bf047461bc61c43a484d11b15220" } -} \ No newline at end of file +} diff --git a/_sources/generated.nix b/_sources/generated.nix index 97b4304..a9e575d 100644 --- a/_sources/generated.nix +++ b/_sources/generated.nix @@ -397,6 +397,18 @@ }; date = "2023-09-30"; }; + waybar = { + pname = "waybar"; + version = "0830796af6aa64ce8bc7453d42876a628777ac68"; + src = fetchFromGitHub { + owner = "catppuccin"; + repo = "waybar"; + rev = "0830796af6aa64ce8bc7453d42876a628777ac68"; + fetchSubmodules = false; + sha256 = "sha256-9lY+v1CTbpw2lREG/h65mLLw5KuT8OJdEPOb+NNC6Fo="; + }; + date = "2024-03-31"; + }; yazi = { pname = "yazi"; version = "0846aed69b2a62d29c98e100af0cf55ca729723d"; diff --git a/modules/home-manager/waybar.nix b/modules/home-manager/waybar.nix new file mode 100644 index 0000000..684e3bb --- /dev/null +++ b/modules/home-manager/waybar.nix @@ -0,0 +1,41 @@ +{ config +, options +, lib +, sources +, ... +}: +let + cfg = config.programs.waybar.catppuccin; + enable = cfg.enable && config.programs.waybar.enable; + styleFile = "${sources.waybar}/themes/${cfg.flavour}.css"; +in +{ + options.programs.waybar.catppuccin = (lib.ctp.mkCatppuccinOpt "waybar") // { + mode = lib.mkOption { + type = lib.types.enum [ + "prependImport" + "createLink" + ]; + default = "prependImport"; + description = '' + Defines how to include the catppuccin theme css file: + + - `prependImport`: Prepends the import statement, if `programs.waybar.style` is a string (with default override priority). + - `createLink`: Creates a symbolic link `~/.config/waybar/catppuccin.css`, which needs to be included in the waybar stylesheet. + ''; + }; + }; + + config = lib.mkIf enable ( + lib.mkMerge [ + (lib.mkIf (cfg.mode == "prependImport") { + programs.waybar.style = lib.mkBefore '' + @import "${styleFile}"; + ''; + }) + (lib.mkIf (cfg.mode == "createLink") { + xdg.configFile."waybar/catppuccin.css".source = styleFile; + }) + ] + ); +} diff --git a/nvfetcher.toml b/nvfetcher.toml index 44a70e2..fa7e43b 100644 --- a/nvfetcher.toml +++ b/nvfetcher.toml @@ -130,6 +130,10 @@ fetch.github = "catppuccin/tmux" src.git = "https://github.com/catppuccin/tofi.git" fetch.github = "catppuccin/tofi" +[waybar] +src.git = "https://github.com/catppuccin/waybar.git" +fetch.github = "catppuccin/waybar" + [yazi] src.git = "https://github.com/catppuccin/yazi.git" fetch.github = "catppuccin/yazi" diff --git a/test.nix b/test.nix index 9ca399b..8b3d94b 100644 --- a/test.nix +++ b/test.nix @@ -84,6 +84,7 @@ testers.runNixOSTest { swaylock = enable; tmux = enable; tofi = enable; + waybar = enable; yazi = enable; zathura = enable; zellij = enable;