From a656b8f48147ce33c5a91042d63c526e121193e2 Mon Sep 17 00:00:00 2001 From: alejandro-angulo Date: Sun, 28 Jul 2024 23:23:20 -0700 Subject: [PATCH] Moved tmux theming from nvim module to tmux module --- modules/home/apps/tmux/default.nix | 3 +++ .../apps/neovim => home/apps/tmux}/tmux_theme | 0 modules/nixos/apps/neovim/default.nix | 17 ++++------------- modules/nixos/apps/neovim/generate_theme.sh | 6 ------ modules/nixos/home/default.nix | 12 ++++++------ 5 files changed, 13 insertions(+), 25 deletions(-) rename modules/{nixos/apps/neovim => home/apps/tmux}/tmux_theme (100%) delete mode 100755 modules/nixos/apps/neovim/generate_theme.sh diff --git a/modules/home/apps/tmux/default.nix b/modules/home/apps/tmux/default.nix index 5174690..c7503c9 100644 --- a/modules/home/apps/tmux/default.nix +++ b/modules/home/apps/tmux/default.nix @@ -14,6 +14,8 @@ in { }; config = lib.mkIf cfg.enable { + xdg.dataFile."tmux-theme".source = ./tmux_theme; + programs.tmux = { enable = true; keyMode = "vi"; @@ -82,6 +84,7 @@ in { # Eye Candy # set -g @plugin 'mattdavis90/base16-tmux' # set -g @colors-base16 'darktooth' + source-file ${config.xdg.dataHome}/tmux-theme; # Smart pane switching with awareness of Vim splits. # See: https://github.com/christoomey/vim-tmux-navigator diff --git a/modules/nixos/apps/neovim/tmux_theme b/modules/home/apps/tmux/tmux_theme similarity index 100% rename from modules/nixos/apps/neovim/tmux_theme rename to modules/home/apps/tmux/tmux_theme diff --git a/modules/nixos/apps/neovim/default.nix b/modules/nixos/apps/neovim/default.nix index 26d0751..0062e60 100644 --- a/modules/nixos/apps/neovim/default.nix +++ b/modules/nixos/apps/neovim/default.nix @@ -3,25 +3,16 @@ lib, pkgs, ... -}: -with lib; let +}: let + inherit (lib) mkIf mkEnableOption; + cfg = config.aa.apps.neovim; in { - options.aa.apps.neovim = with types; { + options.aa.apps.neovim = { enable = mkEnableOption "neovim"; - - tmuxThemePath = mkOption { - type = str; - default = "vim-tmuxline/tmux_theme"; - description = "Where to store tmux theme generated by vim-tmuxline"; - }; }; config = mkIf cfg.enable { environment.systemPackages = with pkgs; [neovim]; - - aa.home.dataFile = { - ${cfg.tmuxThemePath}.source = ./tmux_theme; - }; }; } diff --git a/modules/nixos/apps/neovim/generate_theme.sh b/modules/nixos/apps/neovim/generate_theme.sh deleted file mode 100755 index 0e676b1..0000000 --- a/modules/nixos/apps/neovim/generate_theme.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -# Generates a tmux statusline theme based off the theme in neovim -# May require some edits - -nvim -c ":Tmuxline vim_statusline_1 | TmuxlineSnapshot! $(dirname "$0")/tmux_theme | qa!" diff --git a/modules/nixos/home/default.nix b/modules/nixos/home/default.nix index de662a0..a843679 100644 --- a/modules/nixos/home/default.nix +++ b/modules/nixos/home/default.nix @@ -1,19 +1,19 @@ { options, config, - pkgs, lib, inputs, + namespace, ... -}: -with lib; let - cfg = config.aa.home; +}: let + inherit (lib) mkAliasDefinitions mkOption; + inherit (lib.types) attrs; in { imports = with inputs; [ home-manager.nixosModules.home-manager ]; - options.aa.home = with types; { + options.${namespace}.home = { file = mkOption { type = attrs; default = {}; @@ -37,7 +37,7 @@ in { }; config = { - aa.home.extraOptions = { + ${namespace}.home.extraOptions = { home.stateVersion = config.system.stateVersion; home.file = mkAliasDefinitions options.aa.home.file; xdg = {