NixOS-Config/home-manager/shared/shell/zellij.nix

87 lines
2.6 KiB
Nix

{
lib,
pkgs,
inputs,
...
}: let
layout =
pkgs.writeText "default.kdl"
''
layout {
pane size=1 borderless=true {
plugin location="tab-bar"
}
pane
pane size=2 borderless=true {
plugin location="status-bar"
}
children
pane size=1 borderless=true {
plugin location="file:${inputs.zjstatus.packages.${pkgs.system}.default}/bin/zjstatus.wasm" {
format_left "{mode} Zellij #[fg=yellow,bold]({session})"
format_left "{tabs}"
format_right "{command_git_branch} {datetime}"
format_space " "
border_enabled "true"
border_char ""
border_format "#[fg=green]{char}"
border_position "top"
hide_frame_for_single_pane "false"
mode_normal "#[bg=blue] "
mode_tmux "#[bg=blue] "
// formatting for inactive tabs
tab_normal "#[fg=green] {index} :: {name} "
tab_normal_fullscreen "#[fg=green] {index} :: {name} [] "
tab_normal_sync "#[fg=green] {index} :: {name} <> "
// formatting for the current active tab
tab_active "#[fg=white,bold,italic] {name} {floating_indicator}"
tab_active_fullscreen "#[fg=white,bold,italic] {name} {fullscreen_indicator}"
tab_active_sync "#[fg=white,bold,italic] {name} {sync_indicator}"
// separator between the tabs
tab_separator "#[fg=green,bg=orange] | "
// indicators
tab_sync_indicator "<> "
tab_fullscreen_indicator "[] "
tab_floating_indicator " "
command_git_branch_command "git rev-parse --abbrev-ref HEAD"
command_git_branch_format "#[fg=yellow] {stdout} "
command_git_branch_interval "10"
command_git_branch_rendermode "static"
datetime "#[fg=#yellow,bold] {format} "
datetime_format "%Y-%M-%d %H:%M"
datetime_timezone "Europe/Amsterdam"
}
}
}
'';
in {
programs.zellij = {
# This autostarts zellij on zsh start
# TODO find specific settings for vscode to avoid
enable = true;
enableZshIntegration = true;
};
home.file = {
"layout" = {
source = "${layout}";
target = ".config/zellij/layouts/default.kdl";
};
};
home.file = {
"config" = {
source = ./zellij.kdl;
target = ".config/zellij/config.kdl";
};
};
}