diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix index e154f66..7ec7908 100644 --- a/hosts/laptop/home.nix +++ b/hosts/laptop/home.nix @@ -8,10 +8,4 @@ ../../modules/user/apps.nix ../../modules/user/graphical.nix ]; - - - - # Niri WM declarative configuration files - home.file.".config/niri/config.kdl".source = ../../modules/user/config/niri/config.kdl; - home.file.".config/niri/custom.kdl".source = ../../modules/user/config/niri/custom.kdl; } diff --git a/modules/user/base.nix b/modules/user/base.nix index ac4023d..09976b5 100644 --- a/modules/user/base.nix +++ b/modules/user/base.nix @@ -205,66 +205,21 @@ # Inject modular shell helper scripts directly into .bashrc. # This allows us to keep discrete logic files without cluttering home.nix or base.nix. bashrcExtra = '' - ${builtins.readFile ./shell/wayland.sh} # Wayland clipboard helper (wlc) - ${builtins.readFile ./shell/git.sh} # Git workflow automations (gacp, gitignore) - ${builtins.readFile ./shell/pdf.sh} # Command line PDF decryption helper - ${builtins.readFile ./shell/quicklinks.sh} # Interactive fzf web launcher - ${builtins.readFile ./shell/jump.sh} # Directory jumper & interactive fuzzy navigation - ${builtins.readFile ./shell/todo.sh} # Todo.txt & tuxedo shortcuts and syntax highlighter - - # --- Word Deletion & Readline Keybindings --- - if [[ -n "$BASH_VERSION" ]] && [[ "$-" == *i* ]]; then - # Ctrl+W: Delete entire word under cursor (backward-word + kill-word) - bind '"\C-w": "\eb\ed"' 2>/dev/null - - # Ctrl+Delete: Forward word delete (matches Alacritty \e[3;5~) - bind '"\e[3;5~": kill-word' 2>/dev/null - - # Ctrl+Backspace / Alt+Backspace: Backward word delete (start to cursor) - bind '"\e\x7f": backward-kill-word' 2>/dev/null - bind '"\e\b": backward-kill-word' 2>/dev/null - fi - - # --- Visual Entry --- - # Display system information dashboard upon opening interactive shells - if [[ $- == *i* ]]; then - fastfetch --logo none - fi + ${builtins.readFile ./shell/wayland.sh} # Wayland clipboard helper (wlc) + ${builtins.readFile ./shell/git.sh} # Git workflow automations (gacp, gitignore) + ${builtins.readFile ./shell/pdf.sh} # Command line PDF decryption helper + ${builtins.readFile ./shell/quicklinks.sh} # Interactive fzf web launcher + ${builtins.readFile ./shell/jump.sh} # Directory jumper & interactive fuzzy navigation + ${builtins.readFile ./shell/todo.sh} # Todo.txt & tuxedo shortcuts and syntax highlighter + ${builtins.readFile ./shell/interactive.sh} # Readline word deletion keybindings & fastfetch entry ''; }; }; # 📊 Custom Catnap-style Fastfetch # A stylized, minimalist system information dashboard displayed on shell startup - programs.fastfetch = { - enable = true; - settings = { - display = { - separator = " "; - }; - modules = [ - { key = "╭───────────╮"; type = "custom"; } - { key = "│  user {#keys}│"; type = "title"; format = "{user-name}"; } - { key = "│ 󰇅 hname {#keys}│"; type = "title"; format = "{host-name}"; } - { type = "command"; key = "│ 󱦟 os age {#keys}│"; keyColor = "magenta"; text = "printf \"\\e[0m%s days\\e[0m\" \"$(( ($(date +%s) - $(stat -c %W /)) / 86400 ))\""; } - { key = "│ 󰅐 uptime {#keys}│"; type = "uptime"; } - { key = "│ {icon} distro {#keys}│"; type = "os"; } - { key = "│  kernel {#keys}│"; type = "kernel"; } - { key = "│  wm {#keys}│"; type = "wm"; } - { key = "│ 󰇄 desktop {#keys}│"; type = "de"; } - { key = "│  term {#keys}│"; type = "terminal"; } - { key = "│  shell {#keys}│"; type = "shell"; } - { key = "│ 󰍛 cpu {#keys}│"; type = "cpu"; showPeCoreCount = true; } - { key = "│ 󰉉 root {#keys}│"; type = "disk"; folders = "/"; } - { key = "│ 󰉉 home {#keys}│"; type = "disk"; folders = "/home"; } - { key = "│ 󰉉 media {#keys}│"; type = "disk"; folders = "/media"; } - { key = "│  memory {#keys}│"; type = "memory"; } - { key = "├───────────┤"; type = "custom"; } - { key = "│  colors {#keys}│"; type = "colors"; symbol = "circle"; } - { key = "╰───────────╯"; type = "custom"; } - ]; - }; - }; + programs.fastfetch.enable = true; + home.file.".config/fastfetch/config.jsonc".source = ./config/fastfetch/config.jsonc; # Standalone CLI utilities & system dependencies home.packages = with pkgs; [ diff --git a/modules/user/config/alacritty/alacritty.toml b/modules/user/config/alacritty/alacritty.toml new file mode 100644 index 0000000..4d93fd8 --- /dev/null +++ b/modules/user/config/alacritty/alacritty.toml @@ -0,0 +1,96 @@ +[general] +import = [ + "~/.config/alacritty/dank-theme.toml" +] + +[font] +size = 11.0 + +[font.normal] +family = "FiraCode Nerd Font" +style = "Regular" + +[font.bold] +family = "FiraCode Nerd Font" +style = "Bold" + +[font.italic] +family = "FiraCode Nerd Font" +style = "Italic" + +[font.bold_italic] +family = "FiraCode Nerd Font" +style = "Bold Italic" + +[window] +decorations = "None" +opacity = 1.0 + +[window.padding] +x = 12 +y = 12 + +[scrolling] +history = 3023 + +[cursor] +blink_interval = 500 +unfocused_hollow = true + +[cursor.style] +shape = "Block" +blinking = "On" + +[mouse] +hide_when_typing = true + +[selection] +save_to_clipboard = false + +[bell] +duration = 0 + +[[keyboard.bindings]] +key = "C" +mods = "Control|Shift" +action = "Copy" + +[[keyboard.bindings]] +key = "V" +mods = "Control|Shift" +action = "Paste" + +[[keyboard.bindings]] +key = "N" +mods = "Control|Shift" +action = "SpawnNewInstance" + +[[keyboard.bindings]] +key = "Equals" +mods = "Control|Shift" +action = "IncreaseFontSize" + +[[keyboard.bindings]] +key = "Minus" +mods = "Control" +action = "DecreaseFontSize" + +[[keyboard.bindings]] +key = "Key0" +mods = "Control" +action = "ResetFontSize" + +[[keyboard.bindings]] +key = "Enter" +mods = "Shift" +chars = "\n" + +[[keyboard.bindings]] +key = "Delete" +mods = "Control" +chars = "\u001b[3;5~" + +[[keyboard.bindings]] +key = "Back" +mods = "Control" +chars = "\u001b\u007f" diff --git a/modules/user/config/fastfetch/config.jsonc b/modules/user/config/fastfetch/config.jsonc new file mode 100644 index 0000000..e15a5a2 --- /dev/null +++ b/modules/user/config/fastfetch/config.jsonc @@ -0,0 +1,93 @@ +{ + "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", + "display": { + "separator": " " + }, + "modules": [ + { + "type": "custom", + "key": "╭───────────╮" + }, + { + "type": "title", + "key": "│  user {#keys}│", + "format": "{user-name}" + }, + { + "type": "title", + "key": "│ 󰇅 hname {#keys}│", + "format": "{host-name}" + }, + { + "type": "command", + "key": "│ 󱦟 os age {#keys}│", + "keyColor": "magenta", + "text": "printf \"\\e[0m%s days\\e[0m\" \"$(( ($(date +%s) - $(stat -c %W /)) / 86400 ))\"" + }, + { + "type": "uptime", + "key": "│ 󰅐 uptime {#keys}│" + }, + { + "type": "os", + "key": "│ {icon} distro {#keys}│" + }, + { + "type": "kernel", + "key": "│  kernel {#keys}│" + }, + { + "type": "wm", + "key": "│  wm {#keys}│" + }, + { + "type": "de", + "key": "│ 󰇄 desktop {#keys}│" + }, + { + "type": "terminal", + "key": "│  term {#keys}│" + }, + { + "type": "shell", + "key": "│  shell {#keys}│" + }, + { + "type": "cpu", + "key": "│ 󰍛 cpu {#keys}│", + "showPeCoreCount": true + }, + { + "type": "disk", + "key": "│ 󰉉 root {#keys}│", + "folders": "/" + }, + { + "type": "disk", + "key": "│ 󰉉 home {#keys}│", + "folders": "/home" + }, + { + "type": "disk", + "key": "│ 󰉉 media {#keys}│", + "folders": "/media" + }, + { + "type": "memory", + "key": "│  memory {#keys}│" + }, + { + "type": "custom", + "key": "├───────────┤" + }, + { + "type": "colors", + "key": "│  colors {#keys}│", + "symbol": "circle" + }, + { + "type": "custom", + "key": "╰───────────╯" + } + ] +} diff --git a/modules/user/config/starship.toml b/modules/user/config/starship.toml new file mode 100644 index 0000000..c83c28a --- /dev/null +++ b/modules/user/config/starship.toml @@ -0,0 +1,9 @@ +add_newline = true + +[character] +success_symbol = "[➜](bold green)" +error_symbol = "[➜](bold red)" + +[directory] +style = "bold blue" +truncate_to_repo = true diff --git a/modules/user/graphical.nix b/modules/user/graphical.nix index 7e898e7..572461e 100644 --- a/modules/user/graphical.nix +++ b/modules/user/graphical.nix @@ -3,12 +3,6 @@ # Only imported by desktop and laptop profiles. { inputs, pkgs, ... }: - -let - # Parse true ASCII Escape (0x1b) and DEL (0x7f) bytes so TOML serialization generates real escape sequences - esc = builtins.fromJSON "\"\\u001b\""; - del = builtins.fromJSON "\"\\u007f\""; -in { # Graphical packages managed via Home Manager home.packages = with pkgs; [ @@ -41,63 +35,7 @@ in # GPU-Accelerated Terminal Emulator (Alacritty) programs.alacritty = { enable = true; - settings = { - general = { - import = [ - "~/.config/alacritty/dank-theme.toml" - ]; - }; - - font = { - normal = { family = "FiraCode Nerd Font"; style = "Regular"; }; - bold = { family = "FiraCode Nerd Font"; style = "Bold"; }; - italic = { family = "FiraCode Nerd Font"; style = "Italic"; }; - bold_italic = { family = "FiraCode Nerd Font"; style = "Bold Italic"; }; - size = 11.0; - }; - - window = { - decorations = "None"; - padding = { x = 12; y = 12; }; - opacity = 1.0; - }; - - scrolling = { - history = 3023; - }; - - cursor = { - style = { shape = "Block"; blinking = "On"; }; - blink_interval = 500; - unfocused_hollow = true; - }; - - mouse = { - hide_when_typing = true; - }; - - selection = { - save_to_clipboard = false; - }; - - bell = { - duration = 0; - }; - - keyboard = { - bindings = [ - { key = "C"; mods = "Control|Shift"; action = "Copy"; } - { key = "V"; mods = "Control|Shift"; action = "Paste"; } - { key = "N"; mods = "Control|Shift"; action = "SpawnNewInstance"; } - { key = "Equals"; mods = "Control|Shift"; action = "IncreaseFontSize"; } - { key = "Minus"; mods = "Control"; action = "DecreaseFontSize"; } - { key = "Key0"; mods = "Control"; action = "ResetFontSize"; } - { key = "Enter"; mods = "Shift"; chars = "\n"; } - { key = "Delete"; mods = "Control"; chars = "${esc}[3;5~"; } - { key = "Back"; mods = "Control"; chars = "${esc}${del}"; } - ]; - }; - }; + settings = builtins.fromTOML (builtins.readFile ./config/alacritty/alacritty.toml); }; # Firefox configuration diff --git a/modules/user/shell/interactive.sh b/modules/user/shell/interactive.sh new file mode 100644 index 0000000..2949d4d --- /dev/null +++ b/modules/user/shell/interactive.sh @@ -0,0 +1,18 @@ +# --- Word Deletion & Readline Keybindings --- +if [[ -n "$BASH_VERSION" ]] && [[ "$-" == *i* ]]; then + # Ctrl+W: Delete entire word under cursor (backward-word + kill-word) + bind '"\C-w": "\eb\ed"' 2>/dev/null + + # Ctrl+Delete: Forward word delete (matches Alacritty \e[3;5~) + bind '"\e[3;5~": kill-word' 2>/dev/null + + # Ctrl+Backspace / Alt+Backspace: Backward word delete (start to cursor) + bind '"\e\x7f": backward-kill-word' 2>/dev/null + bind '"\e\b": backward-kill-word' 2>/dev/null +fi + +# --- Visual Entry --- +# Display system information dashboard upon opening interactive shells +if [[ $- == *i* ]]; then + fastfetch --logo none +fi diff --git a/modules/user/terminal.nix b/modules/user/terminal.nix index 3720bee..95d771c 100644 --- a/modules/user/terminal.nix +++ b/modules/user/terminal.nix @@ -12,16 +12,6 @@ programs.starship = { enable = true; enableBashIntegration = true; # Mount prompt configuration inside Bash shells - settings = { - add_newline = true; - character = { - success_symbol = "[➜](bold green)"; - error_symbol = "[➜](bold red)"; - }; - directory = { - style = "bold blue"; - truncate_to_repo = true; # Hides directory path prefixes when navigating inside Git repositories - }; - }; + settings = builtins.fromTOML (builtins.readFile ./config/starship.toml); }; }