From 73bd2b1f2ed7ac2a3c265dadf62ecb404abed8a2 Mon Sep 17 00:00:00 2001 From: m3tm3re
Date: Sun, 26 Apr 2026 11:09:50 +0200 Subject: [PATCH] fix: spec review - add missing fish module to base/shell - Create home/base/shell/fish.nix - Add to base/shell/default.nix imports - Migrate remaining hosts from features.cli.fish to base.shell.fish --- home/base/shell/default.nix | 3 +- home/base/shell/fish.nix | 117 ++++++++++++++++++++++++++++++++++ home/m3tam3re/m3-aether.nix | 5 +- home/m3tam3re/m3-ares.nix | 5 +- home/m3tam3re/m3-daedalus.nix | 5 +- home/m3tam3re/m3-helios.nix | 5 +- home/m3tam3re/m3-hermes.nix | 5 +- 7 files changed, 124 insertions(+), 21 deletions(-) create mode 100644 home/base/shell/fish.nix diff --git a/home/base/shell/default.nix b/home/base/shell/default.nix index b5b0c37..0b02d43 100644 --- a/home/base/shell/default.nix +++ b/home/base/shell/default.nix @@ -1,7 +1,8 @@ -# Shell aggregator — imports Nushell (primary) and Starship prompt. +# Shell aggregator — imports Nushell (primary), Fish, and Starship prompt. {...}: { imports = [ ./nushell.nix + ./fish.nix ./starship.nix ]; } diff --git a/home/base/shell/fish.nix b/home/base/shell/fish.nix new file mode 100644 index 0000000..94e65ec --- /dev/null +++ b/home/base/shell/fish.nix @@ -0,0 +1,117 @@ +# Fish shell configuration exposed under the new base namespace. +{ + config, + lib, + ... +}: +with lib; let + cfg = config.base.shell.fish; +in { + options.base.shell.fish.enable = mkEnableOption "enable fish shell"; + + config = mkIf cfg.enable { + programs.fish = { + enable = true; + interactiveShellInit = '' + # Fish colors using universal nix-colors palette + # Text colors + set -g fish_color_normal ${config.colorScheme.palette.base05} # text + set -g fish_color_param ${config.colorScheme.palette.base05} # text + set -g fish_color_comment ${config.colorScheme.palette.base03} # muted + set -g fish_color_autosuggestion ${config.colorScheme.palette.base03} # muted + + # Command colors + set -g fish_color_command ${config.colorScheme.palette.base0D} # accent6 (blue) + set -g fish_color_quote ${config.colorScheme.palette.base0A} # accent3 (yellow) + set -g fish_color_redirection ${config.colorScheme.palette.base0E} # accent7 (purple) + set -g fish_color_end ${config.colorScheme.palette.base08} # accent1 (red) + set -g fish_color_error ${config.colorScheme.palette.base08} # accent1 (red) + set -g fish_color_operator ${config.colorScheme.palette.base0C} # accent5 (cyan) + set -g fish_color_escape ${config.colorScheme.palette.base09} # accent2 (orange) + + # Path colors + set -g fish_color_cwd ${config.colorScheme.palette.base0B} # accent4 (green) + set -g fish_color_cwd_root ${config.colorScheme.palette.base08} # accent1 (red) + set -g fish_color_valid_path --underline + + # Interactive colors + set -g fish_color_match ${config.colorScheme.palette.base0B} # accent4 (green) + set -g fish_color_selection --background=${config.colorScheme.palette.base02} # overlay + set -g fish_color_search_match --background=${config.colorScheme.palette.base02} # overlay + set -g fish_color_history_current --bold + set -g fish_color_user ${config.colorScheme.palette.base0B} # accent4 (green) + set -g fish_color_host ${config.colorScheme.palette.base0D} # accent6 (blue) + set -g fish_color_cancel -r + + # Pager colors + set -g fish_pager_color_completion normal + set -g fish_pager_color_description ${config.colorScheme.palette.base03} # muted + set -g fish_pager_color_prefix ${config.colorScheme.palette.base0E} # accent7 (purple) + set -g fish_pager_color_progress ${config.colorScheme.palette.base0B} # accent4 (green) + ''; + loginShellInit = '' + set -x NIX_PATH nixpkgs=channel:nixos-unstable + set -x NIX_LOG info + set -x WEBKIT_DISABLE_COMPOSITING_MODE 1 + set -x TERMINAL ghostty + set -x EDITOR nvim + set -x VISUAL zed + set -x XDG_DATA_HOME $HOME/.local/share + set -x FZF_CTRL_R_OPTS " + --preview='bat --color=always -n {}' + --preview-window up:3:hidden:wrap + --bind 'ctrl-/:toggle-preview' + --bind 'ctrl-y:execute-silent(echo -n {2..} | wl-copy)+abort' + --color header:bold + --header 'Press CTRL-Y to copy command into clipboard'" + set -x FZF_DEFAULT_COMMAND fd --type f --exclude .git --follow --hidden + set -x FZF_CTRL_T_COMMAND "$FZF_DEFAULT_COMMAND" + set -x FLAKE $HOME/p/nixos/nixos-config + source /run/agenix/${config.home.username}-secrets + + if test (tty) = "/dev/tty1" + exec uwsm start -F /run/current-system/sw/bin/Hyprland + end + if test (tty) = "/dev/tty2" + exec gamescope -O HDMI-A-1 -W 1920 -H 1080 --adaptive-sync --hdr-enabled --rt --steam -- steam -pipewire-dmabuf -tenfoot + end + ''; + shellAbbrs = { + ".." = "cd .."; + "..." = "cd ../.."; + b = "yazi"; + ls = "eza"; + l = "eza -l --icons --git -a"; + lt = "eza --tree --level=2 --long --icons --git"; + grep = "rg"; + ps = "procs"; + just = "just --unstable"; + node = "bun"; + npx = "bunx"; + fs = "du -ah . | sort -hr | head -n 10"; + + n = "nix"; + nd = "nix develop -c $SHELL"; + ns = "nix shell"; + nsn = "nix shell nixpkgs#"; + nb = "nix build"; + nbn = "nix build nixpkgs#"; + nf = "nix flake"; + + nr = "sudo nixos-rebuild --flake ."; + nrs = "sudo nixos-rebuild switch --flake .#(uname -n)"; + snr = "sudo nixos-rebuild --flake ."; + snrs = "sudo nixos-rebuild --flake . switch"; + hm = "home-manager --flake ."; + hms = "home-manager --flake . switch"; + hmr = "cd ~/projects/nix-configurations; nix flake lock --update-input dotfiles; home-manager --flake .#(whoami)@(hostname) switch"; + + tsu = "sudo tailscale up"; + tsd = "sudo tailscale down"; + + vi = "nvim"; + vim = "nvim"; + }; + }; + }; +} diff --git a/home/m3tam3re/m3-aether.nix b/home/m3tam3re/m3-aether.nix index 510fbb5..a24412e 100644 --- a/home/m3tam3re/m3-aether.nix +++ b/home/m3tam3re/m3-aether.nix @@ -13,13 +13,12 @@ in { context = "server"; }) ./home-server.nix - # Fish shell — no equivalent in new base module yet - ../features/cli/fish.nix ]; # Base CLI tools (new namespace) base = { shell = { + fish.enable = true; starship.enable = true; }; cliTools = { @@ -28,6 +27,4 @@ in { }; }; - # Fish shell (legacy — no new equivalent yet) - features.cli.fish.enable = true; } diff --git a/home/m3tam3re/m3-ares.nix b/home/m3tam3re/m3-ares.nix index 9e2b0aa..ee7593a 100644 --- a/home/m3tam3re/m3-ares.nix +++ b/home/m3tam3re/m3-ares.nix @@ -15,8 +15,6 @@ with lib; { context = "desktop"; }) ./home.nix - # Fish shell — no equivalent in new base module yet - ../features/cli/fish.nix ]; config = mkMerge [ @@ -24,6 +22,7 @@ with lib; { # Base CLI tools (new namespace) base = { shell = { + fish.enable = true; nushell.enable = true; starship.enable = true; }; @@ -35,8 +34,6 @@ with lib; { secrets.enable = true; }; - # Fish shell (legacy — features namespace, no new equivalent yet) - features.cli.fish.enable = true; # Desktop features (new namespace) desktop = { diff --git a/home/m3tam3re/m3-daedalus.nix b/home/m3tam3re/m3-daedalus.nix index f97209c..3c09562 100644 --- a/home/m3tam3re/m3-daedalus.nix +++ b/home/m3tam3re/m3-daedalus.nix @@ -15,8 +15,6 @@ with lib; { context = "desktop"; }) ./home.nix - # Fish shell — no equivalent in new base module yet - ../features/cli/fish.nix ]; config = mkMerge [ @@ -24,6 +22,7 @@ with lib; { # Base CLI tools (new namespace) base = { shell = { + fish.enable = true; nushell.enable = true; starship.enable = true; }; @@ -35,8 +34,6 @@ with lib; { secrets.enable = true; }; - # Fish shell (legacy — no new equivalent yet) - features.cli.fish.enable = true; # Desktop features (new namespace) desktop = { diff --git a/home/m3tam3re/m3-helios.nix b/home/m3tam3re/m3-helios.nix index 27f6b41..17df42f 100644 --- a/home/m3tam3re/m3-helios.nix +++ b/home/m3tam3re/m3-helios.nix @@ -13,13 +13,12 @@ in { context = "server"; }) ./home-server.nix - # Fish shell — no equivalent in new base module yet - ../features/cli/fish.nix ]; # Base CLI tools (new namespace) base = { shell = { + fish.enable = true; starship.enable = true; }; cliTools = { @@ -28,6 +27,4 @@ in { }; }; - # Fish shell (legacy — no new equivalent yet) - features.cli.fish.enable = true; } diff --git a/home/m3tam3re/m3-hermes.nix b/home/m3tam3re/m3-hermes.nix index a70e6b3..e79822d 100644 --- a/home/m3tam3re/m3-hermes.nix +++ b/home/m3tam3re/m3-hermes.nix @@ -13,13 +13,12 @@ in { context = "server"; }) ./home-server.nix - # Fish shell — no equivalent in new base module yet - ../features/cli/fish.nix ]; # Base CLI tools (new namespace) base = { shell = { + fish.enable = true; starship.enable = true; }; cliTools = { @@ -28,6 +27,4 @@ in { }; }; - # Fish shell (legacy — no new equivalent yet) - features.cli.fish.enable = true; }