From 8f930092e54438b5a1bea1126966926a4ff06500 Mon Sep 17 00:00:00 2001 From: seth Date: Sat, 15 Apr 2023 20:22:31 -0400 Subject: [PATCH] feat(home-manager): add support for tmux (#21) --- modules/home-manager/default.nix | 1 + modules/home-manager/tmux.nix | 34 ++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 modules/home-manager/tmux.nix diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 4d28a30..3adaf04 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -9,6 +9,7 @@ ./helix.nix ./gtk.nix ./polybar.nix + ./tmux.nix ]; options.catppuccin = { flavour = lib.mkOption { diff --git a/modules/home-manager/tmux.nix b/modules/home-manager/tmux.nix new file mode 100644 index 0000000..41e6fbf --- /dev/null +++ b/modules/home-manager/tmux.nix @@ -0,0 +1,34 @@ +{ config, pkgs, lib, ... }: +let + cfg = config.programs.tmux.catppuccin; + + plugin = with builtins; + with pkgs; + let rev = "4e48b09a76829edc7b55fbb15467cf0411f07931"; + in tmuxPlugins.mkTmuxPlugin { + pluginName = "catppuccin"; + version = substring 0 7 rev; + src = fetchFromGitHub { + owner = "catppuccin"; + repo = "tmux"; + inherit rev; + sha256 = "sha256-bXEsxt4ozl3cAzV3ZyvbPsnmy0RAdpLxHwN82gvjLdU="; + }; + }; +in { + options.programs.tmux.catppuccin = with lib; { + enable = mkEnableOption "Catppuccin theme"; + flavour = mkOption { + type = types.enum [ "latte" "frappe" "macchiato" "mocha" ]; + default = config.catppuccin.flavour; + description = "Catppuccin flavour for tmux"; + }; + }; + + config.programs.tmux.plugins = with lib; mkIf cfg.enable [ + { + inherit plugin; + extraConfig = "set -g @catppuccin_flavour '${cfg.flavour}'"; + } + ]; +}