Compare commits

...

10 commits

8 changed files with 177 additions and 111 deletions

View file

@ -12,6 +12,7 @@
git.enable = true; git.enable = true;
neovim.enable = true; neovim.enable = true;
starship.enable = true; starship.enable = true;
tmux.enable = true;
utils.enable = true; utils.enable = true;
vifm.enable = true; vifm.enable = true;
zellij.enable = true; zellij.enable = true;

View file

@ -13,8 +13,10 @@
git.enable = true; git.enable = true;
neovim.enable = true; neovim.enable = true;
starship.enable = true; starship.enable = true;
tmux.enable = true;
utils.enable = true; utils.enable = true;
vifm.enable = true; vifm.enable = true;
zellij.enable = true;
zsh.enable = true; zsh.enable = true;
}; };
video = { video = {

View file

@ -11,6 +11,7 @@
git.enable = true; git.enable = true;
neovim.enable = true; neovim.enable = true;
starship.enable = true; starship.enable = true;
tmux.enable = true;
utils.enable = true; utils.enable = true;
vifm.enable = true; vifm.enable = true;
zsh.enable = true; zsh.enable = true;

View file

@ -19,14 +19,14 @@ local schemas = {}
local kubernetes = "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/refs/heads/master/v1.29.6-standalone-strict/all.json" local kubernetes = "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/refs/heads/master/v1.29.6-standalone-strict/all.json"
local flux2 = "https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/refs/heads/main/all.json" local flux2 = "https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/refs/heads/main/all.json"
local gitlab = "https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json" local gitlab_ci = "https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json"
local taskfile = "https://taskfile.dev/schema.json" local taskfile = "https://taskfile.dev/schema.json"
local podmonitor = "https://raw.githubusercontent.com/datreeio/CRDs-catalog/refs/heads/main/monitoring.coreos.com/podmonitor_v1.json" local podmonitor = "https://raw.githubusercontent.com/datreeio/CRDs-catalog/refs/heads/main/monitoring.coreos.com/podmonitor_v1.json"
local servicemonitor = "https://raw.githubusercontent.com/datreeio/CRDs-catalog/refs/heads/main/monitoring.coreos.com/servicemonitor_v1.json" local servicemonitor = "https://raw.githubusercontent.com/datreeio/CRDs-catalog/refs/heads/main/monitoring.coreos.com/servicemonitor_v1.json"
local prometheus = "https://raw.githubusercontent.com/datreeio/CRDs-catalog/refs/heads/main/monitoring.coreos.com/prometheus_v1.json" local prometheus = "https://raw.githubusercontent.com/datreeio/CRDs-catalog/refs/heads/main/monitoring.coreos.com/prometheus_v1.json"
local ingress = "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/refs/heads/master/v1.30.1/ingress-networking-v1.json" local ingress = "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/refs/heads/master/v1.30.1/ingress-networking-v1.json"
local lefthook = "https://json.schemastore.org/lefthook.json" local lefthook = "https://raw.githubusercontent.com/evilmartians/lefthook/refs/heads/master/schema.json"
local github = "https://json.schemastore.org/github-workflow.json" local github_workflow = "https://json.schemastore.org/github-workflow.json"
schemas[kubernetes] = { schemas[kubernetes] = {
"templates/*deployment.yaml", "templates/*deployment.yaml",
@ -131,13 +131,14 @@ lspconfig.tflint.setup{
local cfg = require("yaml-companion").setup({ local cfg = require("yaml-companion").setup({
schemas = { schemas = {
{ name = "Flux2", uri = flux2 }, { name = "Flux2", uri = flux2 },
{ name = "Gitlab", uri = gitlab }, { name = "Gitlab", uri = gitlab_ci },
{ name = "Taskfile", uri = taskfile }, { name = "Taskfile", uri = taskfile },
{ name = "PodMonitor", uri = podmonitor }, { name = "PodMonitor", uri = podmonitor },
{ name = "ServiceMonitor", uri = servicemonitor }, { name = "ServiceMonitor", uri = servicemonitor },
{ name = "Prometheus", uri = prometheus }, { name = "Prometheus", uri = prometheus },
{ name = "Kubernetes", uri = kubernetes }, { name = "Kubernetes", uri = kubernetes },
{ name = "Lefthook", uri = lefthook }, { name = "Lefthook", uri = lefthook },
{ name = "Github Workflow", uri = github_workflow},
}, },
lspconfig = { lspconfig = {
capabilities = capabilities, capabilities = capabilities,
@ -149,32 +150,33 @@ local cfg = require("yaml-companion").setup({
"gotk-sync.yaml", "gotk-sync.yaml",
"gotk-*.yaml", "gotk-*.yaml",
}, },
[gitlab] = { [gitlab_ci] = {
"ci/*.{yaml,yml}", "ci/*.{yaml,yml}",
".gitlab/**/*.{yaml,yml}", ".gitlab/**/*.{yaml,yml}",
".gitlab-ci.{yaml,yml}", ".gitlab-ci.{yaml,yml}",
}, },
[taskfile] = { [taskfile] = {
"**/Taskfile*.{yaml,yml}", "Taskfile*.{yaml,yml}",
"taskfile*.{yaml,yml}",
"taskfiles/**/*.{yaml,yml}", "taskfiles/**/*.{yaml,yml}",
}, },
[podmonitor] = { [podmonitor] = {
"*podmonitor*.{yaml,yml}" "*podmonitor*.{yaml,yml}",
}, },
[servicemonitor] = { [servicemonitor] = {
"*servicemonitor*.{yaml,yml}" "*servicemonitor*.{yaml,yml}",
}, },
[prometheus] = { [prometheus] = {
"*prometheus*.{yaml,yml}" "*prometheus*.{yaml,yml}",
}, },
[ingress] = { [ingress] = {
"*ingress*.{yaml,yml}" "*ingress*.{yaml,yml}",
}, },
[lefthook] = { [lefthook] = {
"**/lefthook.*" "lefthook.{yaml,yml}",
}, },
[github] = { [github_workflow] = {
".github/workflow/**/*.{yaml,yml}" ".github/workflow/**/*.{yaml,yml}",
} }
}, },
}, },

View file

@ -0,0 +1,67 @@
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.cli.tmux;
in
{
options.modules.cli.tmux = {
enable = mkEnableOption "enable Tmux";
};
config = mkIf cfg.enable {
programs.tmux = {
enable = true;
aggressiveResize = true;
baseIndex = 1;
customPaneNavigationAndResize = false;
escapeTime = 0;
focusEvents = true;
keyMode = "vi";
mouse = true;
prefix = "C-a";
terminal = "tmux-256color";
extraConfig = ''
bind -n -N "Select pane to the left of the active pane" M-h select-pane -L
bind -n -N "Select pane below the active pane" M-j select-pane -D
bind -n -N "Select pane above the active pane" M-k select-pane -U
bind -n -N "Select pane to the right of the active pane" M-l select-pane -R
bind -n -r -N "Resize the pane left by 5" M-H resize-pane -L 5
bind -n -r -N "Resize the pane down by 5" M-J resize-pane -D 5
bind -n -r -N "Resize the pane up by 5" M-K resize-pane -U 5
bind -n -r -N "Resize the pane right by 5" M-L resize-pane -R 5
bind -n -n M-n split-window -h -c "#{pane_current_path}"
bind -n -n M-N split-window -v -c "#{pane_current_path}"
# Theme
set -g status-interval 2
setw -g automatic-rename on # rename window to reflect current program
set -g renumber-windows on # renumber windows when a window is closed
set -g set-titles on
set -g mode-style bg=colour18,fg=colour7
set -g set-titles-string "#T"
set -g status-bg colour0
set -g status-fg colour7
set -g message-style bg=colour19,fg=colour7
setw -g window-status-current-format '#[fg=colour18,bg=colour11] #I\
#[bg=colour19,fg=colour7,bold] #W\
#{?window_active,󰎂 ,}#{?window_marked_flag,󰃃 ,}#{?window_activity_flag, ,}#{?window_silence_flag,󰝟 ,}#{?window_zoomed_flag,󱀅 ,}#{?window_bell_flag,#[fg=colour1]󱈸 ,}'
set -g pane-border-style fg=colour19
set -g pane-active-border-style fg=colour4
setw -g window-status-format '#[bg=color12,fg=colour19] #I\
#[bg=colour18,fg=colour7,dim] #W\
#{?window_last_flag, ,}#{?window_marked_flag,󰃃 ,}#{?window_activity_flag, ,}#{?window_silence_flag,󰝟 ,}#{?window_zoomed_flag,󱀅 ,}#{?window_bell_flag,#[fg=colour1]󱈸 ,}'
set -g status-left "#[bg=colour0, fg=colour6] #S "
set -g status-right ""
'';
plugins = with pkgs; [
tmuxPlugins.tmux-fzf
];
};
};
}

View file

@ -88,6 +88,7 @@ in
} }
precmd_functions+=(zle-keymap-select) precmd_functions+=(zle-keymap-select)
zle -N zle-keymap-select zle -N zle-keymap-select
base16_default-dark
''; '';
completionInit = '' completionInit = ''
autoload -Uz compinit autoload -Uz compinit
@ -105,15 +106,6 @@ in
rev = "588691ba71b47e75793ed9edfcfaa058326a6f41"; rev = "588691ba71b47e75793ed9edfcfaa058326a6f41";
hash = "sha256-X89FsG9QICDw3jZvOCB/KsPBVOLUeE7xN3VCtf0DD3E="; hash = "sha256-X89FsG9QICDw3jZvOCB/KsPBVOLUeE7xN3VCtf0DD3E=";
}; };
}
{
name = "history-search-multi-word";
src = pkgs.fetchFromGitHub {
owner = "zdharma-continuum";
repo = "history-search-multi-word";
rev = "c4dcddc1cd17e7e0909471703f3526170db0f475";
hash = "sha256-KgKm9qzFnwXDXwmTruPgC0tjmiTY5AiGdrWW4zDWUF4=";
};
}]; }];
localVariables = { localVariables = {
BASE16_THEME = "$HOME/.config/zsh/plugins/base16"; BASE16_THEME = "$HOME/.config/zsh/plugins/base16";

View file

@ -11,6 +11,7 @@
./cli/git ./cli/git
./cli/neovim ./cli/neovim
./cli/starship ./cli/starship
./cli/tmux
./cli/utils ./cli/utils
./cli/vifm ./cli/vifm
./cli/zellij ./cli/zellij

View file

@ -37,47 +37,46 @@ in
left down up right terminal; left down up right terminal;
in in
{ {
# navigate only with direction or workspace
"${mod}+${left}" = "focus left";
"${mod}+${down}" = "focus down";
"${mod}+${up}" = "focus up";
"${mod}+${right}" = " focus right";
"${mod}+1" = "workspace $ws1"; "${mod}+1" = "workspace $ws1";
"${mod}+Shift+1" = "move container to workspace $ws1";
"${mod}+2" = "workspace $ws2"; "${mod}+2" = "workspace $ws2";
"${mod}+Shift+2" = "move container to workspace $ws2";
"${mod}+3" = "workspace $ws3"; "${mod}+3" = "workspace $ws3";
"${mod}+Shift+3" = "move container to workspace $ws3";
"${mod}+4" = "workspace $ws4"; "${mod}+4" = "workspace $ws4";
"${mod}+Shift+4" = "move container to workspace $ws4";
"${mod}+5" = "workspace $ws5"; "${mod}+5" = "workspace $ws5";
"${mod}+Shift+5" = "move container to workspace $ws5";
"${mod}+6" = "workspace $ws6"; "${mod}+6" = "workspace $ws6";
"${mod}+Shift+6" = "move container to workspace $ws6";
"${mod}+7" = "workspace $ws7"; "${mod}+7" = "workspace $ws7";
"${mod}+Shift+7" = "move container to workspace $ws7";
"${mod}+8" = "workspace $ws8"; "${mod}+8" = "workspace $ws8";
"${mod}+Shift+8" = "move container to workspace $ws8";
"${mod}+9" = "workspace $ws9"; "${mod}+9" = "workspace $ws9";
"${mod}+Shift+9" = "move container to workspace $ws9";
"${mod}+0" = "workspace $ws0"; "${mod}+0" = "workspace $ws0";
# move with Shift and direction
"${mod}+Shift+${left}" = "move left";
"${mod}+Shift+${down}" = "move down";
"${mod}+Shift+${up}" = "move up";
"${mod}+Shift+${right}" = "move right";
"${mod}+Shift+1" = "move container to workspace $ws1";
"${mod}+Shift+2" = "move container to workspace $ws2";
"${mod}+Shift+3" = "move container to workspace $ws3";
"${mod}+Shift+4" = "move container to workspace $ws4";
"${mod}+Shift+5" = "move container to workspace $ws5";
"${mod}+Shift+6" = "move container to workspace $ws6";
"${mod}+Shift+7" = "move container to workspace $ws7";
"${mod}+Shift+8" = "move container to workspace $ws8";
"${mod}+Shift+9" = "move container to workspace $ws9";
"${mod}+Shift+0" = "move container to workspace $ws0"; "${mod}+Shift+0" = "move container to workspace $ws0";
"${mod}+Ctrl+${right}" = "move workspace to output right";
"${mod}+Ctrl+${left}" = "move workspace to output left";
"${mod}+Return" = "exec ${terminal}"; "${mod}+Return" = "exec ${terminal}";
"${mod}+Shift+q" = "kill";
"${mod}+d" = "exec ${pkgs.fuzzel}/bin/fuzzel"; "${mod}+d" = "exec ${pkgs.fuzzel}/bin/fuzzel";
"${mod}+Shift+c" = "reload"; # manage windows manager actions with Alt
"${mod}+Alt+k" = "kill";
"${mod}+Alt+c" = "reload";
"${mod}+Alt+Backspace" = "exec swaynag -t warning -m 'Exit sway?' -B 'Yes' 'swaymsg exit'";
"${mod}+Alt+l" = "exec ${pkgs.swaylock}/bin/swaylock"; "${mod}+Alt+l" = "exec ${pkgs.swaylock}/bin/swaylock";
"${mod}+${left} focus" = "left"; # Manage windows placement
"${mod}+${down} focus" = "down";
"${mod}+${up} focus" = "up";
"${mod}+${right} focus" = "right";
"${mod}+Left" = "focus left";
"${mod}+Down" = "focus down";
"${mod}+Up" = "focus up";
"${mod}+Right" = "focus right";
"${mod}+Shift+${left} move" = "left";
"${mod}+Shift+${down} move" = "down";
"${mod}+Shift+${up} move" = "up";
"${mod}+Shift+${right} move" = "right";
"${mod}+Shift+Left" = "move left";
"${mod}+Shift+Down" = "move down";
"${mod}+Shift+Up" = "move up";
"${mod}+Shift+Right" = "move right";
"${mod}+b" = "splith"; "${mod}+b" = "splith";
"${mod}+v" = "splitv"; "${mod}+v" = "splitv";
"${mod}+s" = "layout stacking"; "${mod}+s" = "layout stacking";
@ -89,6 +88,7 @@ in
"${mod}+a" = "focus parent"; "${mod}+a" = "focus parent";
"${mod}+Shift+p" = "move scratchpad"; "${mod}+Shift+p" = "move scratchpad";
"${mod}+p" = "scratchpad show"; "${mod}+p" = "scratchpad show";
# Media stuff
"${mod}+F1" = "exec ${pkgs.brightnessctl}/bin/brightnessctl s 1%-"; "${mod}+F1" = "exec ${pkgs.brightnessctl}/bin/brightnessctl s 1%-";
"${mod}+F2" = "exec ${pkgs.brightnessctl}/bin/brightnessctl s +1%"; "${mod}+F2" = "exec ${pkgs.brightnessctl}/bin/brightnessctl s +1%";
"${mod}+F3" = "exec ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_SINK@ 5%-"; "${mod}+F3" = "exec ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_SINK@ 5%-";