feat(programs): add tmux

This commit is contained in:
Moritz Böhme 2023-04-25 18:55:15 +02:00
parent 69454aba52
commit 52650a3c84
Signed by: moritz
GPG key ID: 970C6E89EB0547A9
9 changed files with 67 additions and 1 deletions

View file

@ -9,6 +9,7 @@ in
(import ./catppuccin.nix (import ./catppuccin.nix
{ {
inherit config lib pkgs; inherit config lib pkgs;
flavor = "mocha";
rosewater = "f2d5cf"; rosewater = "f2d5cf";
flamingo = "eebebe"; flamingo = "eebebe";
pink = "f4b8e4"; pink = "f4b8e4";

View file

@ -9,6 +9,7 @@ in
(import ./catppuccin.nix (import ./catppuccin.nix
{ {
inherit config lib pkgs; inherit config lib pkgs;
flavor = "mocha";
rosewater = "dc8a78"; rosewater = "dc8a78";
flamingo = "dd7878"; flamingo = "dd7878";
pink = "ea76cb"; pink = "ea76cb";

View file

@ -9,6 +9,7 @@ in
(import ./catppuccin.nix (import ./catppuccin.nix
{ {
inherit config lib pkgs; inherit config lib pkgs;
flavor = "mocha";
rosewater = "f4dbd6"; rosewater = "f4dbd6";
flamingo = "f0c6c6"; flamingo = "f0c6c6";
pink = "f5bde6"; pink = "f5bde6";

View file

@ -9,6 +9,7 @@ in
(import ./catppuccin.nix (import ./catppuccin.nix
{ {
inherit config lib pkgs; inherit config lib pkgs;
flavor = "mocha";
rosewater = "f5e0dc"; rosewater = "f5e0dc";
flamingo = "f2cdcd"; flamingo = "f2cdcd";
pink = "f5c2e7"; pink = "f5c2e7";

View file

@ -1,4 +1,6 @@
{ config { config
, pkgs
, flavor
, rosewater , rosewater
, flamingo , flamingo
, pink , pink
@ -127,6 +129,12 @@
color7 #${subtext1} color7 #${subtext1}
color15 #${subtext0} color15 #${subtext0}
''; '';
tmux.plugins = with pkgs.tmuxPlugins; [
{
plugin = catppuccin;
extraConfig = "set -g @catppuccin_flavour '${flavor}'";
}
];
zathura.extraConfig = '' zathura.extraConfig = ''
set window-title-basename "true" set window-title-basename "true"
set selection-clipboard "clipboard" set selection-clipboard "clipboard"

View file

@ -1,5 +1,6 @@
{ config { config
, lib , lib
, pkgs
, ... , ...
}: }:
@ -97,6 +98,9 @@ in
active_border_color #f8f8f2 active_border_color #f8f8f2
inactive_border_color #6272a4 inactive_border_color #6272a4
''; '';
tmux.plugins = with pkgs.tmuxPlugins; [
dracula
];
zathura.extraConfig = '' zathura.extraConfig = ''
set window-title-basename "true" set window-title-basename "true"
set selection-clipboard "clipboard" set selection-clipboard "clipboard"

View file

@ -62,6 +62,7 @@ in
fish.enable = true; fish.enable = true;
git.enable = true; git.enable = true;
gpg.enable = true; gpg.enable = true;
tmux.enable = true;
}; };
}; };
@ -99,7 +100,6 @@ in
gparted gparted
neofetch neofetch
ripgrep ripgrep
tmux
up up
viu viu
wget wget

View file

@ -25,6 +25,7 @@
./ssh.nix ./ssh.nix
./sway.nix ./sway.nix
./thunar.nix ./thunar.nix
./tmux.nix
./zathura.nix ./zathura.nix
./zsh.nix ./zsh.nix
]; ];

49
modules/programs/tmux.nix Normal file
View file

@ -0,0 +1,49 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.my.programs.tmux;
in
{
options.my.programs.tmux = {
enable = mkEnableOption "tmux";
autoAttach = mkEnableOption "autoAttach";
};
config = mkIf cfg.enable {
my.shell.abbreviations.t = "tmux";
home-manager.users.moritz.programs.tmux = {
enable = true;
clock24 = true;
customPaneNavigationAndResize = true;
keyMode = "vi";
mouse = true;
newSession = true;
prefix = "C-Space";
sensibleOnTop = false;
plugins = with pkgs.tmuxPlugins; [
sensible
tmux-fzf
yank
];
};
home-manager.users.moritz.programs = {
fzf.tmux.enableShellIntegration = true;
fish.interactiveShellInit =
let
insideVariables = [ "$TMUX" "$INSIDE_EMACS" "$EMACS" "$VIM" "$VSCODE_RESOLVING_ENVIRONMENT" ];
insideVariableMissing = concatStringsSep " && " (map (x: "test -z ${x}") insideVariables);
in
mkIf cfg.autoAttach
''
if ! fish_is_root_user && test "$TERM_PROGRAM" != 'vscode' && ${insideVariableMissing}
if test -z $tmux_autostarted
set -x tmux_autostarted true
tmux a
end
end
'';
};
};
}