From 9947d603d09a03866755a30e5375f95d50872d8c Mon Sep 17 00:00:00 2001 From: punkfairie Date: Sun, 20 Oct 2024 13:12:44 -0700 Subject: [PATCH] feat(tmux): Catppuccin -> Rose Pine --- .sources/sources.json | 15 ++--------- modules/home-manager/tmux.nix | 49 ++++++++++++----------------------- 2 files changed, 19 insertions(+), 45 deletions(-) diff --git a/.sources/sources.json b/.sources/sources.json index 432d7ef..70c9ff0 100644 --- a/.sources/sources.json +++ b/.sources/sources.json @@ -360,18 +360,6 @@ "url": "https://github.com/rose-pine/tm-theme/archive/c4235f9a65fd180ac0f5e4396e3a86e21a0884ec.tar.gz", "hash": "19k0r1mrhqhlf1xfzvd1q8ihpic86f84kbmgy0m314w3w9cbqf4f" }, - "tmux": { - "type": "Git", - "repository": { - "type": "GitHub", - "owner": "catppuccin", - "repo": "tmux" - }, - "branch": "main", - "revision": "1612a23174a6771ac466312eb156f83b8b89d907", - "url": "https://github.com/catppuccin/tmux/archive/1612a23174a6771ac466312eb156f83b8b89d907.tar.gz", - "hash": "0mrj9kasry1csfh24gpdh713ha3ia2vfljjd81kw40rg1nn58g4d" - }, "tofi": { "type": "Git", "repository": { @@ -434,4 +422,5 @@ } }, "version": 3 -} \ No newline at end of file +} + diff --git a/modules/home-manager/tmux.nix b/modules/home-manager/tmux.nix index 7cfab56..4bd9146 100644 --- a/modules/home-manager/tmux.nix +++ b/modules/home-manager/tmux.nix @@ -3,44 +3,29 @@ lib, pkgs, ... -}: -let - inherit (lib) - ctp - mkOption - types - concatStrings - ; - inherit (config.catppuccin) sources; - cfg = config.programs.tmux.catppuccin; +}: let + cfg = config.programs.tmux.rose-pine; enable = cfg.enable && config.programs.tmux.enable; - - plugin = - # TODO @getchoo: upstream this in nixpkgs - pkgs.tmuxPlugins.mkTmuxPlugin { - pluginName = "catppuccin"; - version = builtins.substring 0 7 sources.tmux.revision; - src = sources.tmux; +in { + options.programs.tmux.rose-pine = + lib.rp.mkRosePineOpt {name = "tmux";} + // { + extraConfig = lib.mkOption { + type = lib.types.lines; + description = "Additional configuration for the rose-pine plugin."; + default = ""; + example = '' + set -g @rose-pine "application session user host date_time" + ''; + }; }; -in -{ - options.programs.tmux.catppuccin = ctp.mkCatppuccinOpt { name = "tmux"; } // { - extraConfig = mkOption { - type = types.lines; - description = "Additional configuration for the catppuccin plugin."; - default = ""; - example = '' - set -g @catppuccin_status_modules_right "application session user host date_time" - ''; - }; - }; config.programs.tmux.plugins = lib.mkIf enable [ { - inherit plugin; - extraConfig = concatStrings [ + plugin = pkgs.tmuxPlugins.rose-pine; + extraConfig = lib.concatStrings [ '' - set -g @catppuccin_flavor '${cfg.flavor}' + set -g @rose_pine_variant '${cfg.flavor}' '' cfg.extraConfig ];