From 542c97067c7cd5277031e004e69561cb91d9c0e2 Mon Sep 17 00:00:00 2001 From: Armin Date: Sat, 20 Jul 2024 03:56:54 +0200 Subject: [PATCH] 2024/07/20-03:56:54 --- modules/default.nix | 1 + modules/nvim.nix | 82 ++++++++++++++++++++++----------------------- modules/tmux.nix | 54 +++++++++++++++++++++++++++++ src/base.nix | 4 --- src/configs.nix | 47 -------------------------- 5 files changed, 95 insertions(+), 93 deletions(-) create mode 100644 modules/tmux.nix diff --git a/modules/default.nix b/modules/default.nix index a73e731..73fc96a 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -6,6 +6,7 @@ ++ [ ./sysconf.nix ./nvim.nix + ./tmux.nix ./cert-der.nix ./alpaca.nix ]; diff --git a/modules/nvim.nix b/modules/nvim.nix index 8f5fd04..44e65f6 100644 --- a/modules/nvim.nix +++ b/modules/nvim.nix @@ -1,46 +1,44 @@ -{ lib, ... }: +{ lib, pkgs, ... }: { - programs = { - nixvim = { - enable = true; - viAlias = true; - vimAlias = true; - colorschemes.vscode.enable = true; - opts = { - number = true; - relativenumber = true; - undofile = true; - encoding = "utf-8"; - signcolumn = "yes"; - belloff = "all"; - wrap = false; - wildmenu = true; - modeline = true; - modelines = 1; - tabstop = 2; - softtabstop = 2; - shiftwidth = 2; - expandtab = true; - smarttab = true; - autoindent = true; - }; - clipboard = { - register = "unnamedplus"; - providers.wl-copy.enable = true; - }; - plugins = { - lightline.enable = true; - indent-blankline.enable = true; - lastplace.enable = true; - treesitter.enable = true; - treesitter-context.enable = true; - cmp.enable = true; - nvim-autopairs.enable = true; - lsp = { - enable = true; - servers = { - nixd.enable = true; - }; + programs.nixvim = { + enable = true; + viAlias = true; + vimAlias = true; + colorschemes.vscode.enable = true; + opts = { + number = true; + relativenumber = true; + undofile = true; + encoding = "utf-8"; + signcolumn = "yes"; + belloff = "all"; + wrap = false; + wildmenu = true; + modeline = true; + modelines = 1; + tabstop = 2; + softtabstop = 2; + shiftwidth = 2; + expandtab = true; + smarttab = true; + autoindent = true; + }; + clipboard = { + register = "unnamedplus"; + providers.wl-copy.enable = true; + }; + plugins = { + lightline.enable = true; + indent-blankline.enable = true; + lastplace.enable = true; + treesitter.enable = true; + treesitter-context.enable = true; + cmp.enable = true; + nvim-autopairs.enable = true; + lsp = { + enable = true; + servers = { + nixd.enable = true; }; }; }; diff --git a/modules/tmux.nix b/modules/tmux.nix new file mode 100644 index 0000000..4061e8b --- /dev/null +++ b/modules/tmux.nix @@ -0,0 +1,54 @@ +{ lib, pkgs, ... }: +{ + programs.tmux = { + enable = true; + extraConfig = '' + bind -r C-a send-prefix + bind r source-file /etc/tmux.conf + bind - split-window -v -c '#{pane_current_path}' + bind \\ split-window -h -c '#{pane_current_path}' + bind _ split-window -vf -c '#{pane_current_path}' + bind | split-window -hf -c '#{pane_current_path}' + bind -r C-k resize-pane -U + bind -r C-j resize-pane -D + bind -r C-h resize-pane -L + bind -r C-l resize-pane -R + bind -r k select-pane -U + bind -r j select-pane -D + bind -r h select-pane -L + bind -r l select-pane -R + + + bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe + bind -T copy-mode-vi Enter send-keys -X copy-pipe + + set -g base-index 1 + set -g mode-keys vi + set -g prefix C-a + set -g history-limit 50000 + set -g set-titles on + set -g mouse on + set -g monitor-activity on + set -g default-terminal "screen-256color" + set -g default-command "''${SHELL}" + set -s set-clipboard external + set -g copy-command "${pkgs.wl-clipboard}/bin/wl-copy" + set -ga terminal-overrides ",*256col*:Tc" + set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q' + set -g status-interval 60 + set -g status-bg black + set -g status-fg green + set -g window-status-activity-style fg=red + set -g status-left-length 100 + set -g status-left '#{?client_prefix,#[fg=red]PFX, } #[fg=green](#S) ' + set -g status-right-length 100 + set -g status-right '#[fg=yellow]%Y/%m(%b)/%d %a %H:%M#[default]' + set -g pane-border-lines double + set -g clock-mode-style 24 + + set-environment -g COLORTERM "truecolor" + ''; + }; +} + +# vim:expandtab ts=2 sw=2 diff --git a/src/base.nix b/src/base.nix index 10a21a2..fff7fc3 100644 --- a/src/base.nix +++ b/src/base.nix @@ -100,10 +100,6 @@ with lib; }; ssh.extraConfig = customConfigs.SSH_CLIENT_CONFIG; dconf.enable = mkDefault true; - tmux = { - enable = mkDefault true; - extraConfig = customConfigs.TMUX_CONFIG; - }; git = { enable = mkDefault true; config = { diff --git a/src/configs.nix b/src/configs.nix index 9486cfb..2563691 100644 --- a/src/configs.nix +++ b/src/configs.nix @@ -90,53 +90,6 @@ with lib; IdentitiesOnly yes ServerAliveInterval 60 ''; - - TMUX_CONFIG = mkDefault '' - bind -r C-a send-prefix - bind r source-file /etc/tmux.conf - bind - split-window -v -c '#{pane_current_path}' - bind \\ split-window -h -c '#{pane_current_path}' - bind _ split-window -vf -c '#{pane_current_path}' - bind | split-window -hf -c '#{pane_current_path}' - bind -r C-k resize-pane -U - bind -r C-j resize-pane -D - bind -r C-h resize-pane -L - bind -r C-l resize-pane -R - bind -r k select-pane -U - bind -r j select-pane -D - bind -r h select-pane -L - bind -r l select-pane -R - - - bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe - bind -T copy-mode-vi Enter send-keys -X copy-pipe - - set -g base-index 1 - set -g mode-keys vi - set -g prefix C-a - set -g history-limit 50000 - set -g set-titles on - set -g mouse on - set -g monitor-activity on - set -g default-terminal "screen-256color" - set -g default-command "''${SHELL}" - set -s set-clipboard external - set -g copy-command "${pkgs.wl-clipboard}/bin/wl-copy" - set -ga terminal-overrides ",*256col*:Tc" - set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q' - set -g status-interval 60 - set -g status-bg black - set -g status-fg green - set -g window-status-activity-style fg=red - set -g status-left-length 100 - set -g status-left '#{?client_prefix,#[fg=red]PFX, } #[fg=green](#S) ' - set -g status-right-length 100 - set -g status-right '#[fg=yellow]%Y/%m(%b)/%d %a %H:%M#[default]' - set -g pane-border-lines double - set -g clock-mode-style 24 - - set-environment -g COLORTERM "truecolor" - ''; } # vim:expandtab ts=2 sw=2