refactor: complete rewrite
This commit is contained in:
parent
19a4bbda3c
commit
8e81943cf9
399 changed files with 3396 additions and 8042 deletions
6
modules/home/console/default.nix
Normal file
6
modules/home/console/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./shell
|
||||
./tools
|
||||
];
|
||||
}
|
||||
13
modules/home/console/shell/bash/default.nix
Normal file
13
modules/home/console/shell/bash/default.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
lib,
|
||||
osConfig,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
inherit (osConfig.ooknet.host) admin;
|
||||
cfg = osConfig.ooknet.console.shell.bash;
|
||||
in {
|
||||
config = mkIf (cfg.enable || admin.shell == "bash") {
|
||||
programs.bash.enable = true;
|
||||
};
|
||||
}
|
||||
7
modules/home/console/shell/default.nix
Normal file
7
modules/home/console/shell/default.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
imports = [
|
||||
./fish
|
||||
./zsh
|
||||
./bash
|
||||
];
|
||||
}
|
||||
24
modules/home/console/shell/fish/aliases.nix
Normal file
24
modules/home/console/shell/fish/aliases.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) getExe;
|
||||
inherit (pkgs) bat eza dust nh;
|
||||
in {
|
||||
programs.fish = {
|
||||
shellAliases = {
|
||||
cat = "${getExe bat}";
|
||||
ls = "${getExe eza} -a --icons --group-directories-first";
|
||||
lst = "${getExe eza} -T -L 5 --icons --group-directories-first";
|
||||
du = "${getExe dust}";
|
||||
gitroot = "cd (git rev-parse --show-toplevel)";
|
||||
};
|
||||
shellAbbrs = {
|
||||
f = "cd $FLAKE";
|
||||
fe = "$EDITOR $FLAKE";
|
||||
|
||||
nswitch = "${getExe nh} os switch";
|
||||
};
|
||||
};
|
||||
}
|
||||
10
modules/home/console/shell/fish/binds.nix
Normal file
10
modules/home/console/shell/fish/binds.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
programs.fish = {
|
||||
functions = {
|
||||
fish_user_key_bindings = ''
|
||||
bind --preset -M insert \cf nvim '+Telescope find_files' $FLAKE
|
||||
bind --preset -M insert \ec fzf_cd_widget
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
66
modules/home/console/shell/fish/default.nix
Normal file
66
modules/home/console/shell/fish/default.nix
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
osConfig,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
inherit (osConfig.ooknet.host) admin;
|
||||
|
||||
cfg = config.ooknet.home.fish;
|
||||
in {
|
||||
imports = [
|
||||
./plugins.nix
|
||||
./binds.nix
|
||||
./aliases.nix
|
||||
];
|
||||
|
||||
options.ooknet.home.fish.enable = mkEnableOption "";
|
||||
|
||||
config = mkIf (cfg.enable || admin.shell == "fish") {
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
# disable the default greeting
|
||||
functions = {fish_greeting = "";};
|
||||
interactiveShellInit =
|
||||
# Use vim bindings and cursors
|
||||
''
|
||||
fish_vi_key_bindings
|
||||
set fish_cursor_default block blink
|
||||
set fish_cursor_insert line blink
|
||||
set fish_cursor_replace_one underscore blink
|
||||
set fish_cursor_visual block
|
||||
''
|
||||
+
|
||||
# Use terminal colors
|
||||
''
|
||||
set -U fish_color_autosuggestion brblack
|
||||
set -U fish_color_cancel -r
|
||||
set -U fish_color_command brgreen
|
||||
set -U fish_color_comment brmagenta
|
||||
set -U fish_color_cwd green
|
||||
set -U fish_color_cwd_root red
|
||||
set -U fish_color_end brmagenta
|
||||
set -U fish_color_error brred
|
||||
set -U fish_color_escape brcyan
|
||||
set -U fish_color_history_current --bold
|
||||
set -U fish_color_host normal
|
||||
set -U fish_color_match --background=brblue
|
||||
set -U fish_color_normal normal
|
||||
set -U fish_color_operator cyan
|
||||
set -U fish_color_param brblue
|
||||
set -U fish_color_quote yellow
|
||||
set -U fish_color_redirection bryellow
|
||||
set -U fish_color_search_match 'bryellow' '--background=brblack'
|
||||
set -U fish_color_selection 'white' '--bold' '--background=brblack'
|
||||
set -U fish_color_status red
|
||||
set -U fish_color_user brgreen
|
||||
set -U fish_color_valid_path --underline
|
||||
set -U fish_pager_color_completion normal
|
||||
set -U fish_pager_color_description yellow
|
||||
set -U fish_pager_color_prefix 'white' '--bold' '--underline'
|
||||
set -U fish_pager_color_progress 'brwhite' '--background=cyan'
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
18
modules/home/console/shell/fish/plugins.nix
Normal file
18
modules/home/console/shell/fish/plugins.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{pkgs, ...}: {
|
||||
programs.fish = {
|
||||
plugins = [
|
||||
{
|
||||
name = "done";
|
||||
inherit (pkgs.fishPlugins.done) src;
|
||||
}
|
||||
{
|
||||
name = "autopair";
|
||||
inherit (pkgs.fishPlugins.autopair) src;
|
||||
}
|
||||
{
|
||||
name = "colored-man-pages";
|
||||
inherit (pkgs.fishPlugins.colored-man-pages) src;
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
32
modules/home/console/shell/zsh/default.nix
Normal file
32
modules/home/console/shell/zsh/default.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
osConfig,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
inherit (osConfig.ooknet.host) admin;
|
||||
|
||||
cfg = config.ooknet.home.zsh;
|
||||
in {
|
||||
imports = [
|
||||
./plugins.nix
|
||||
];
|
||||
|
||||
options.ooknet.home.zsh.enable = mkEnableOption "";
|
||||
|
||||
config = mkIf (cfg.enable || admin.shell == "zsh") {
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
autocd = true;
|
||||
enableCompletion = true;
|
||||
autosuggestion.enable = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
dotDir = ".config/zsh";
|
||||
history = {
|
||||
expireDuplicatesFirst = true;
|
||||
path = "${config.xdg.dataHome}/zsh_history";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
14
modules/home/console/shell/zsh/plugins.nix
Normal file
14
modules/home/console/shell/zsh/plugins.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{pkgs, ...}: {
|
||||
programs.zsh.plugins = [
|
||||
{
|
||||
name = "fast-syntax-highlighting";
|
||||
file = "fast-syntax-highlighting";
|
||||
src = "${pkgs.zsh-fast-syntax-highlighting}/share/zsh/site-functions";
|
||||
}
|
||||
{
|
||||
name = "zsh-autopair";
|
||||
file = "autopair.zsh";
|
||||
src = "${pkgs.zsh-autopair}/share/zsh/zsh-autopair";
|
||||
}
|
||||
];
|
||||
}
|
||||
29
modules/home/console/tools/bat.nix
Normal file
29
modules/home/console/tools/bat.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
lib,
|
||||
osConfig,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
inherit (builtins) attrValues;
|
||||
cfg = osConfig.ooknet.console.tools.bat;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
programs.bat = {
|
||||
enable = true;
|
||||
extraPackages = attrValues {
|
||||
inherit
|
||||
(pkgs.bat-extras)
|
||||
batgrep
|
||||
prettybat
|
||||
batwatch
|
||||
batman
|
||||
;
|
||||
};
|
||||
config = {
|
||||
# TODO: custom theme
|
||||
theme = "base16";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
14
modules/home/console/tools/btop.nix
Normal file
14
modules/home/console/tools/btop.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
lib,
|
||||
osConfig,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
cfg = osConfig.ooknet.console.tools.btop;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
programs.btop = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
17
modules/home/console/tools/default.nix
Normal file
17
modules/home/console/tools/default.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
imports = [
|
||||
./bat.nix
|
||||
./btop.nix
|
||||
./git.nix
|
||||
./fzf.nix
|
||||
./ssh.nix
|
||||
./eza.nix
|
||||
./utils.nix
|
||||
./ffmpeg.nix
|
||||
./direnv.nix
|
||||
./starship.nix
|
||||
./nixIndex.nix
|
||||
./multiplexer
|
||||
./editor
|
||||
];
|
||||
}
|
||||
15
modules/home/console/tools/direnv.nix
Normal file
15
modules/home/console/tools/direnv.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
lib,
|
||||
osConfig,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
cfg = osConfig.ooknet.console.tools.direnv;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
5
modules/home/console/tools/editor/default.nix
Normal file
5
modules/home/console/tools/editor/default.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
imports = [
|
||||
./neovim.nix
|
||||
];
|
||||
}
|
||||
17
modules/home/console/tools/editor/neovim.nix
Normal file
17
modules/home/console/tools/editor/neovim.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
osConfig,
|
||||
lib,
|
||||
self',
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
inherit (osConfig.ooknet) console;
|
||||
|
||||
cfg = osConfig.ooknet.console.tools.nvim;
|
||||
in {
|
||||
config = mkIf (cfg.enable || console.editor == "nvim") {
|
||||
home.packages = [self'.packages.ook-vim];
|
||||
home.sessionVariables.EDITOR = mkIf (console.editor == "nvim") "nvim";
|
||||
};
|
||||
}
|
||||
|
||||
16
modules/home/console/tools/eza.nix
Normal file
16
modules/home/console/tools/eza.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
lib,
|
||||
osConfig,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
cfg = osConfig.ooknet.console.tools.eza;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
programs.eza = {
|
||||
enable = true;
|
||||
git = true;
|
||||
icons = "auto";
|
||||
};
|
||||
};
|
||||
}
|
||||
14
modules/home/console/tools/ffmpeg.nix
Normal file
14
modules/home/console/tools/ffmpeg.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
lib,
|
||||
osConfig,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
cfg = osConfig.ooknet.console.tools.ffmpeg;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
# TODO: configure scripts
|
||||
home.packages = [pkgs.ffmpeg];
|
||||
};
|
||||
}
|
||||
25
modules/home/console/tools/fzf.nix
Normal file
25
modules/home/console/tools/fzf.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
lib,
|
||||
osConfig,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
inherit (osConfig.ooknet.host) admin;
|
||||
cfg = osConfig.ooknet.console.tools.fzf;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
programs.fzf = {
|
||||
enable = true;
|
||||
enableFishIntegration = mkIf (admin.shell == "fish") true;
|
||||
defaultCommand = "rg --files --hidden";
|
||||
changeDirWidgetOptions = [
|
||||
"--preview 'eza --icons -L 3 -T --color always {} | head -200'"
|
||||
"--exact"
|
||||
];
|
||||
fileWidgetCommand = "rg --files";
|
||||
fileWidgetOptions = [
|
||||
"--preview 'bat --color=always {}'"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
26
modules/home/console/tools/git.nix
Normal file
26
modules/home/console/tools/git.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
osConfig,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
inherit (builtins) attrValues;
|
||||
inherit (osConfig.ooknet.host) admin;
|
||||
cfg = osConfig.ooknet.console.tools.git;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
package = pkgs.gitAndTools.gitFull;
|
||||
userName = admin.gitName;
|
||||
userEmail = admin.gitEmail;
|
||||
ignores = [".direnv" "result"];
|
||||
lfs.enable = true;
|
||||
};
|
||||
|
||||
home.packages = attrValues {
|
||||
inherit (pkgs) lazygit gh;
|
||||
};
|
||||
};
|
||||
}
|
||||
5
modules/home/console/tools/multiplexer/default.nix
Normal file
5
modules/home/console/tools/multiplexer/default.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
imports = [
|
||||
./zellij
|
||||
];
|
||||
}
|
||||
199
modules/home/console/tools/multiplexer/zellij/default.nix
Normal file
199
modules/home/console/tools/multiplexer/zellij/default.nix
Normal file
|
|
@ -0,0 +1,199 @@
|
|||
{
|
||||
osConfig,
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (osConfig.ooknet.appearance.colorscheme) slug palette;
|
||||
inherit (osConfig.ooknet) console;
|
||||
inherit (osConfig.ooknet.host) admin;
|
||||
inherit (lib) mkIf;
|
||||
|
||||
cfg = osConfig.ooknet.console.tools.zellij;
|
||||
in {
|
||||
config = mkIf (cfg.enable || console.multiplexer == "zellij") {
|
||||
programs.zellij = {
|
||||
enable = true;
|
||||
settings = {
|
||||
theme = "${slug}";
|
||||
default_shell = "${admin.shell}";
|
||||
default_layout = "default";
|
||||
pane_frames = false;
|
||||
scrollback_editor = "${console.editor}";
|
||||
themes = {
|
||||
"${slug}" = {
|
||||
fg = "#${palette.base05}";
|
||||
bg = "#${palette.base00}";
|
||||
black = "#${palette.base00}";
|
||||
red = "#${palette.base08}";
|
||||
green = "#${palette.base0B}";
|
||||
yellow = "#${palette.base0A}";
|
||||
blue = "#${palette.base0D}";
|
||||
magenta = "#${palette.base0E}";
|
||||
cyan = "#${palette.base0C}";
|
||||
white = "#${palette.base05}";
|
||||
orange = "#${palette.base09}";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Layouts
|
||||
xdg.configFile = {
|
||||
# Default layout
|
||||
"zellij/layouts/default.kdl" = import ./layouts/defaultLayout.nix {inherit pkgs config osConfig;};
|
||||
# Layout for bash scripts
|
||||
"zellij/layouts/script.kdl" = import ./layouts/scriptLayout.nix {inherit pkgs config osConfig;};
|
||||
# Layout for configuring my flake
|
||||
"zellij/layouts/flake.kdl" = import ./layouts/flakeLayout.nix {inherit pkgs config osConfig;};
|
||||
# Additional keybinds
|
||||
"zellij/config.kdl".text =
|
||||
# kdl
|
||||
''
|
||||
keybinds clear-defaults=true {
|
||||
shared_except "locked" {
|
||||
bind "Alt 1" { GoToTab 1; }
|
||||
bind "Alt 2" { GoToTab 2; }
|
||||
bind "Alt 3" { GoToTab 3; }
|
||||
bind "Alt 4" { GoToTab 4; }
|
||||
bind "Alt 5" { GoToTab 5; }
|
||||
bind "Alt 6" { GoToTab 6; }
|
||||
bind "Alt 7" { GoToTab 7; }
|
||||
bind "Alt 8" { GoToTab 8; }
|
||||
bind "Alt 9" { GoToTab 9; }
|
||||
bind "Alt -" { Resize "Decrease" ; }
|
||||
bind "Alt =" { Resize "Increase" ; }
|
||||
}
|
||||
|
||||
locked {
|
||||
bind "Alt g" { SwitchToMode "Normal" ; }
|
||||
}
|
||||
|
||||
resize {
|
||||
bind "Alt r" { SwitchToMode "Normal" ; }
|
||||
bind "h" "Left" { Resize "Increase Left" ; }
|
||||
bind "j" "Down" { Resize "Increase Down" ; }
|
||||
bind "k" "Up" { Resize "Increase Up" ; }
|
||||
bind "l" "Right" { Resize "Increase Right" ; }
|
||||
}
|
||||
|
||||
pane {
|
||||
bind "Alt p" { SwitchToMode "Normal" ; }
|
||||
bind "c" { Clear ; }
|
||||
bind "e" { TogglePaneEmbedOrFloating ; SwitchToMode "Normal" ; }
|
||||
bind "f" { ToggleFocusFullscreen ; SwitchToMode "Normal" ; }
|
||||
bind "j" "Down" { NewPane "Down" ; SwitchToMode "Normal" ; }
|
||||
bind "l" "Right" { NewPane "Right" ; SwitchToMode "Normal" ; }
|
||||
bind "n" { NewPane ; SwitchToMode "Normal" ; }
|
||||
bind "p" { SwitchFocus ; SwitchToMode "Normal" ; }
|
||||
bind "r" { SwitchToMode "RenamePane" ; PaneNameInput 0 ; }
|
||||
bind "w" { ToggleFloatingPanes ; SwitchToMode "Normal" ; }
|
||||
bind "x" { CloseFocus ; SwitchToMode "Normal" ; }
|
||||
bind "z" { TogglePaneFrames ; SwitchToMode "Normal" ; }
|
||||
}
|
||||
move {
|
||||
bind "Alt m" { SwitchToMode "Normal"; }
|
||||
bind "h" "Left" { MovePane "Left" ; }
|
||||
bind "j" "Down" { MovePane "Down" ; }
|
||||
bind "k" "Up" { MovePane "Up" ; }
|
||||
bind "l" "Right" { MovePane "Right" ; }
|
||||
}
|
||||
tab {
|
||||
bind "Alt t" { SwitchToMode "Normal" ; }
|
||||
bind "b" { BreakPane; SwitchToMode "Normal" ; }
|
||||
bind "h" { MoveTab "Left" ; }
|
||||
bind "l" { MoveTab "Right" ; }
|
||||
bind "n" { NewTab ; SwitchToMode "Normal" ; }
|
||||
bind "r" { SwitchToMode "RenameTab" ; TabNameInput 0 ; }
|
||||
bind "x" { CloseTab ; SwitchToMode "Normal" ; }
|
||||
bind "1" { GoToTab 1 ; SwitchToMode "Normal" ; }
|
||||
bind "2" { GoToTab 2 ; SwitchToMode "Normal" ; }
|
||||
bind "3" { GoToTab 3 ; SwitchToMode "Normal" ; }
|
||||
bind "4" { GoToTab 4 ; SwitchToMode "Normal" ; }
|
||||
bind "5" { GoToTab 5 ; SwitchToMode "Normal" ; }
|
||||
bind "6" { GoToTab 6 ; SwitchToMode "Normal" ; }
|
||||
bind "7" { GoToTab 7 ; SwitchToMode "Normal" ; }
|
||||
bind "8" { GoToTab 8 ; SwitchToMode "Normal" ; }
|
||||
bind "9" { GoToTab 9 ; SwitchToMode "Normal" ; }
|
||||
}
|
||||
scroll {
|
||||
bind "Alt s" { SwitchToMode "Normal" ; }
|
||||
bind "e" { EditScrollback; SwitchToMode "Normal" ; }
|
||||
bind "d" { HalfPageScrollDown ; }
|
||||
bind "u" { HalfPageScrollUp ; }
|
||||
bind "j" "Down" { ScrollDown ; }
|
||||
bind "k" "Up" { ScrollUp ; }
|
||||
bind "Home" { ScrollToTop ; SwitchToMode "Normal" ; }
|
||||
bind "End" { ScrollToBottom ; SwitchToMode "Normal" ; }
|
||||
bind "PageDown" { PageScrollDown ; }
|
||||
bind "PageUp" { PageScrollUp ; }
|
||||
bind "s" { SwitchToMode "EnterSearch" ; SearchInput 0 ; }
|
||||
}
|
||||
search {
|
||||
bind "Alt s" { SwitchToMode "Normal" ; }
|
||||
bind "n" { Search "down" ; }
|
||||
bind "p" { Search "up" ; }
|
||||
bind "c" { SearchToggleOption "CaseSensitivity" ; }
|
||||
bind "w" { SearchToggleOption "Wrap" ; }
|
||||
bind "o" { SearchToggleOption "WholeWord" ; }
|
||||
}
|
||||
entersearch {
|
||||
bind "Alt c" "Esc" { SwitchToMode "Scroll" ; }
|
||||
bind "Enter" { SwitchToMode "Search" ; }
|
||||
}
|
||||
renametab {
|
||||
bind "Alt c" { SwitchToMode "Normal" ; }
|
||||
bind "Esc" { UndoRenameTab ; SwitchToMode "Tab" ; }
|
||||
}
|
||||
renamepane {
|
||||
bind "Alt c" { SwitchToMode "Normal"; }
|
||||
bind "Esc" { UndoRenamePane; SwitchToMode "Pane"; }
|
||||
}
|
||||
session {
|
||||
bind "Alt o" { SwitchToMode "Normal" ; }
|
||||
bind "d" { Detach ; }
|
||||
bind "w" {
|
||||
LaunchOrFocusPlugin "session-manager" {
|
||||
floating true
|
||||
move_to_focused_tab true
|
||||
};
|
||||
SwitchToMode "Normal"
|
||||
}
|
||||
}
|
||||
shared_except "locked" {
|
||||
bind "Alt g" { SwitchToMode "Locked" ; }
|
||||
bind "Alt q" { Quit ; }
|
||||
bind "Alt h" "Alt Left" { MoveFocusOrTab "Left" ; }
|
||||
bind "Alt l" "Alt Right" { MoveFocusOrTab "Right" ; }
|
||||
bind "Alt j" "Alt Down" { MoveFocus "Down" ; }
|
||||
bind "Alt k" "Alt Up" { MoveFocus "Up" ; }
|
||||
bind "Alt [" { PreviousSwapLayout ; }
|
||||
bind "Alt ]" { NextSwapLayout ; }
|
||||
}
|
||||
shared_except "normal" "locked" {
|
||||
bind "Enter" "Esc" { SwitchToMode "Normal" ; }
|
||||
}
|
||||
shared_except "pane" "locked" {
|
||||
bind "Alt p" { SwitchToMode "Pane" ; }
|
||||
}
|
||||
shared_except "resize" "locked" {
|
||||
bind "Alt r" { SwitchToMode "Resize" ; }
|
||||
}
|
||||
shared_except "scroll" "locked" {
|
||||
bind "Alt s" { SwitchToMode "Scroll" ; }
|
||||
}
|
||||
shared_except "session" "locked" {
|
||||
bind "Alt o" { SwitchToMode "Session" ; }
|
||||
}
|
||||
shared_except "tab" "locked" {
|
||||
bind "Alt t" { SwitchToMode "Tab" ; }
|
||||
}
|
||||
shared_except "move" "locked" {
|
||||
bind "Alt m" { SwitchToMode "Move" ; }
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
{
|
||||
pkgs,
|
||||
osConfig,
|
||||
...
|
||||
}: let
|
||||
inherit (osConfig.ooknet.appearance.colorscheme) palette;
|
||||
in {
|
||||
text =
|
||||
# kdl
|
||||
''
|
||||
layout {
|
||||
default_tab_template {
|
||||
pane size=2 borderless=true {
|
||||
plugin location="file:${pkgs.zjstatus}/bin/zjstatus.wasm" {
|
||||
format_left "{mode}"
|
||||
format_right "{session} {command_git_branch} {datetime}"
|
||||
format_center "#[fg=#${palette.base0D},bold] {tabs}"
|
||||
format_space ""
|
||||
|
||||
border_enabled "true"
|
||||
border_char "─"
|
||||
border_format "#[fg=#${palette.base05}]{char}"
|
||||
border_position "bottom"
|
||||
|
||||
hide_frame_for_single_pane "true"
|
||||
|
||||
mode_normal "#[fg=#${palette.base0D}] "
|
||||
mode_tmux "#[fg=#${palette.base0E}] "
|
||||
mode_pane "#[fg=#${palette.base08}] "
|
||||
mode_tab "#[fg=#${palette.base08}] "
|
||||
mode_rename_tab "#[fg=#${palette.base08}] "
|
||||
mode_rename_pane "#[fg=#${palette.base08}] "
|
||||
mode_session "#[fg=#${palette.base08}] "
|
||||
mode_locked "#[fg=#${palette.base05}] "
|
||||
mode_move "#[fg=#${palette.base0B}] "
|
||||
mode_resize "#[fg=#${palette.base0B}] "
|
||||
mode_prompt "#[fg=#${palette.base0A}] "
|
||||
mode_search "#[fg=#${palette.base0A}] "
|
||||
mode_enter_search "#[fg=#${palette.base0A}] "
|
||||
|
||||
tab_normal "#[bg=#${palette.base01}] {name} "
|
||||
tab_active "#[bg=#${palette.base02}] {name} "
|
||||
tab_separator " "
|
||||
|
||||
command_git_branch_command "git rev-parse --abbrev-ref HEAD"
|
||||
command_git_branch_format "#[fg=#${palette.base0C}] {stdout} "
|
||||
command_git_branch_interval "10"
|
||||
command_git_branch_rendermode "static"
|
||||
|
||||
datetime "#[fg=#${palette.base05},bold] {format} "
|
||||
datetime_format "%I:%M %p"
|
||||
datetime_timezone "${osConfig.time.timeZone}"
|
||||
}
|
||||
}
|
||||
children
|
||||
}
|
||||
tab name="terminal" focus=true {
|
||||
pane name="term" focus=true
|
||||
}
|
||||
}
|
||||
'';
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
{
|
||||
pkgs,
|
||||
osConfig,
|
||||
...
|
||||
}: let
|
||||
inherit (osConfig.ooknet.appearance.colorscheme) palette;
|
||||
in {
|
||||
text =
|
||||
/*
|
||||
kdl
|
||||
*/
|
||||
''
|
||||
layout {
|
||||
default_tab_template {
|
||||
pane size=2 borderless=true {
|
||||
plugin location="file:${pkgs.zjstatus}/bin/zjstatus.wasm" {
|
||||
format_left "{mode}"
|
||||
format_right "{session} {command_git_branch} {datetime}"
|
||||
format_center "#[fg=#${palette.base0D},bold] {tabs}"
|
||||
format_space ""
|
||||
|
||||
border_enabled "true"
|
||||
border_char "─"
|
||||
border_format "#[fg=#${palette.base05}]{char}"
|
||||
border_position "bottom"
|
||||
|
||||
hide_frame_for_single_pane "true"
|
||||
|
||||
mode_normal "#[fg=#${palette.base0D}] "
|
||||
mode_tmux "#[fg=#${palette.base0E}] "
|
||||
mode_pane "#[fg=#${palette.base08}] "
|
||||
mode_tab "#[fg=#${palette.base08}] "
|
||||
mode_rename_tab "#[fg=#${palette.base08}] "
|
||||
mode_rename_pane "#[fg=#${palette.base08}] "
|
||||
mode_session "#[fg=#${palette.base08}] "
|
||||
mode_locked "#[fg=#${palette.base05}] "
|
||||
mode_move "#[fg=#${palette.base0B}] "
|
||||
mode_resize "#[fg=#${palette.base0B}] "
|
||||
mode_prompt "#[fg=#${palette.base0A}] "
|
||||
mode_search "#[fg=#${palette.base0A}] "
|
||||
mode_enter_search "#[fg=#${palette.base0A}] "
|
||||
|
||||
tab_normal "#[bg=#${palette.base01}] {name} "
|
||||
tab_active "#[bg=#${palette.base02}] {name} "
|
||||
tab_separator " "
|
||||
|
||||
command_git_branch_command "git rev-parse --abbrev-ref HEAD"
|
||||
command_git_branch_format "#[fg=#${palette.base0C}] {stdout} "
|
||||
command_git_branch_interval "10"
|
||||
command_git_branch_rendermode "static"
|
||||
|
||||
datetime "#[fg=#${palette.base05},bold] {format} "
|
||||
datetime_format "%I:%M %p"
|
||||
datetime_timezone "${osConfig.time.timeZone}"
|
||||
}
|
||||
}
|
||||
children
|
||||
}
|
||||
tab name="terminal" focus=true {
|
||||
pane name="term" cwd="$FLAKE" focus=true
|
||||
}
|
||||
tab name="editor" {
|
||||
pane name="edit" edit="$FLAKE"
|
||||
}
|
||||
tab name="git" {
|
||||
pane name="git" cwd="$FLAKE" command="lazygit"
|
||||
}
|
||||
}
|
||||
'';
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
{
|
||||
pkgs,
|
||||
osConfig,
|
||||
...
|
||||
}: let
|
||||
inherit (osConfig.ooknet.appearance.colorscheme) palette;
|
||||
in {
|
||||
text =
|
||||
/*
|
||||
kdl
|
||||
*/
|
||||
''
|
||||
layout {
|
||||
default_tab_template {
|
||||
pane size=2 borderless=true {
|
||||
plugin location="file:${pkgs.zjstatus}/bin/zjstatus.wasm" {
|
||||
format_left "{mode}"
|
||||
format_right "{session} {command_git_branch} {datetime}"
|
||||
format_center "#[fg=#${palette.base0D},bold] {tabs}"
|
||||
format_space ""
|
||||
|
||||
border_enabled "true"
|
||||
border_char "─"
|
||||
border_format "#[fg=#${palette.base05}]{char}"
|
||||
border_position "bottom"
|
||||
|
||||
hide_frame_for_single_pane "true"
|
||||
|
||||
mode_normal "#[fg=#${palette.base0D}] "
|
||||
mode_tmux "#[fg=#${palette.base0E}] "
|
||||
mode_pane "#[fg=#${palette.base08}] "
|
||||
mode_tab "#[fg=#${palette.base08}] "
|
||||
mode_rename_tab "#[fg=#${palette.base08}] "
|
||||
mode_rename_pane "#[fg=#${palette.base08}] "
|
||||
mode_session "#[fg=#${palette.base08}] "
|
||||
mode_locked "#[fg=#${palette.base05}] "
|
||||
mode_move "#[fg=#${palette.base0B}] "
|
||||
mode_resize "#[fg=#${palette.base0B}] "
|
||||
mode_prompt "#[fg=#${palette.base0A}] "
|
||||
mode_search "#[fg=#${palette.base0A}] "
|
||||
mode_enter_search "#[fg=#${palette.base0A}] "
|
||||
|
||||
tab_normal "#[bg=#${palette.base01}] {name} "
|
||||
tab_active "#[bg=#${palette.base02}] {name} "
|
||||
tab_separator " "
|
||||
|
||||
command_git_branch_command "git rev-parse --abbrev-ref HEAD"
|
||||
command_git_branch_format "#[fg=#${palette.base0C}] {stdout} "
|
||||
command_git_branch_interval "10"
|
||||
command_git_branch_rendermode "static"
|
||||
|
||||
datetime "#[fg=#${palette.base05},bold] {format} "
|
||||
datetime_format "%I:%M %p"
|
||||
datetime_timezone "${osConfig.time.timeZone}"
|
||||
}
|
||||
}
|
||||
children
|
||||
}
|
||||
tab name="edit" focus=true {
|
||||
pane edit="./" name="edit" focus=true size="85%" borderless=true
|
||||
pane name="term" focus=false size="15%" borderless=false
|
||||
}
|
||||
tab name="git" focus=false {
|
||||
pane name="git" focus=false command="lazygit"
|
||||
}
|
||||
}
|
||||
'';
|
||||
}
|
||||
22
modules/home/console/tools/nixIndex.nix
Normal file
22
modules/home/console/tools/nixIndex.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
lib,
|
||||
osConfig,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
cfg = osConfig.ooknet.console.tools.nixIndex;
|
||||
in {
|
||||
imports = [inputs.nix-index-db.hmModules.nix-index];
|
||||
config = mkIf cfg.enable {
|
||||
programs = {
|
||||
nix-index = {
|
||||
enable = true;
|
||||
symlinkToCacheHome = true;
|
||||
};
|
||||
command-not-found.enable = false;
|
||||
nix-index-database.comma.enable = true;
|
||||
};
|
||||
home.sessionVariables.NIX_AUTO_RUN = "1";
|
||||
};
|
||||
}
|
||||
23
modules/home/console/tools/ssh.nix
Normal file
23
modules/home/console/tools/ssh.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
lib,
|
||||
osConfig,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
cfg = osConfig.ooknet.console.tools.ssh;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
compression = true;
|
||||
hashKnownHosts = true;
|
||||
matchBlocks = {
|
||||
"github.com" = {
|
||||
user = "git";
|
||||
hostname = "github.com";
|
||||
identityFile = "${osConfig.age.secrets.github_key.path}";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
75
modules/home/console/tools/starship.nix
Normal file
75
modules/home/console/tools/starship.nix
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
{
|
||||
osConfig,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = osConfig.ooknet.console.tools.starship;
|
||||
inherit (lib) concatStrings mkIf;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
settings = {
|
||||
format = concatStrings [
|
||||
"$username"
|
||||
"$hostname"
|
||||
"$nix_shell"
|
||||
"$shlvl"
|
||||
"$directory"
|
||||
"$git_branch"
|
||||
"$git_commit"
|
||||
"$git_state"
|
||||
"$git_status"
|
||||
"$jobs"
|
||||
"$character"
|
||||
];
|
||||
|
||||
directory = {
|
||||
truncation_length = 0;
|
||||
truncate_to_repo = true;
|
||||
};
|
||||
|
||||
fill = {
|
||||
symbol = " ";
|
||||
disabled = false;
|
||||
};
|
||||
|
||||
character = {
|
||||
error_symbol = "[](bold red)";
|
||||
success_symbol = "[](bold green)";
|
||||
vimcmd_symbol = "[](bold yellow)";
|
||||
vimcmd_visual_symbol = "[](bold cyan)";
|
||||
vimcmd_replace_symbol = "[](bold purple)";
|
||||
vimcmd_replace_one_symbol = "[](bold purple)";
|
||||
};
|
||||
|
||||
aws.symbol = " ";
|
||||
conda.symbol = " ";
|
||||
dart.symbol = " ";
|
||||
directory.read_only = " ";
|
||||
docker_context.symbol = " ";
|
||||
elixir.symbol = " ";
|
||||
elm.symbol = " ";
|
||||
gcloud.symbol = " ";
|
||||
git_branch.symbol = " ";
|
||||
golang.symbol = " ";
|
||||
hg_branch.symbol = " ";
|
||||
java.symbol = " ";
|
||||
julia.symbol = " ";
|
||||
memory_usage.symbol = " ";
|
||||
nim.symbol = " ";
|
||||
nodejs.symbol = " ";
|
||||
package.symbol = " ";
|
||||
perl.symbol = " ";
|
||||
php.symbol = " ";
|
||||
python.symbol = " ";
|
||||
ruby.symbol = " ";
|
||||
rust.symbol = " ";
|
||||
scala.symbol = " ";
|
||||
shlvl.symbol = "";
|
||||
swift.symbol = " ";
|
||||
terraform.symbol = "";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
63
modules/home/console/tools/utils.nix
Normal file
63
modules/home/console/tools/utils.nix
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
osConfig,
|
||||
self',
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
inherit (builtins) attrValues;
|
||||
|
||||
cfg = osConfig.ooknet.console.tools.utils;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = attrValues {
|
||||
inherit
|
||||
(pkgs)
|
||||
bc # Calculator
|
||||
|
||||
# file utility
|
||||
|
||||
duf
|
||||
du-dust
|
||||
fd
|
||||
ripgrep
|
||||
# archive
|
||||
|
||||
zip
|
||||
unzip
|
||||
unrar
|
||||
# file transfer
|
||||
|
||||
rsync
|
||||
wget
|
||||
httpie # Better curl
|
||||
|
||||
# resource manager
|
||||
|
||||
powertop
|
||||
#shell scripting
|
||||
|
||||
gum
|
||||
# audio ctrl
|
||||
|
||||
pamixer
|
||||
diffsitter # Better diff
|
||||
jq # JSON pretty printer and manipulator
|
||||
tldr # Community maintained help pages
|
||||
progress
|
||||
killall
|
||||
acpi
|
||||
# Notifications
|
||||
|
||||
libnotify
|
||||
# Nix tooling
|
||||
|
||||
alejandra
|
||||
;
|
||||
|
||||
#AI
|
||||
inherit (self'.packages) repopack;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue