From 5fb34c7188ff6a9fd7b1e6da81e54afead171231 Mon Sep 17 00:00:00 2001 From: Alex Mickelson Date: Tue, 10 Mar 2026 09:29:17 -0600 Subject: [PATCH 1/2] fish updates --- nix/home-manager/ai-office-server.home.nix | 37 ++--------- nix/home-manager/ai-vm.home.nix | 26 +------- nix/home-manager/alex.home.nix | 35 ++-------- nix/home-manager/fish.home.nix | 75 ++++++++++++++++++++++ nix/home-manager/work.home.nix | 48 +++----------- 5 files changed, 97 insertions(+), 124 deletions(-) create mode 100644 nix/home-manager/fish.home.nix diff --git a/nix/home-manager/ai-office-server.home.nix b/nix/home-manager/ai-office-server.home.nix index da4aad2..1db61b6 100644 --- a/nix/home-manager/ai-office-server.home.nix +++ b/nix/home-manager/ai-office-server.home.nix @@ -1,5 +1,12 @@ { pkgs, ... }: { + imports = [ ./fish.home.nix ]; + + customFish = { + dotnetPackage = pkgs.dotnetCorePackages.sdk_8_0; + bitwardenSshAgent = true; + }; + home.packages = with pkgs; [ vscode-fhs gnome-software @@ -43,37 +50,7 @@ package = pkgs.gnome-themes-extra; }; }; - programs.fish = { - enable = true; - shellInit = '' -function commit - git add --all - git commit -m "$argv" - git push -end -# have ctrl+backspace delete previous word -bind \e\[3\;5~ kill-word -# have ctrl+delete delete following word -bind \b backward-kill-word - -set -U fish_user_paths ~/.local/bin $fish_user_paths -#set -U fish_user_paths ~/.dotnet $fish_user_paths -#set -U fish_user_paths ~/.dotnet/tools $fish_user_paths - -export VISUAL=vim -export EDITOR="$VISUAL" -export DOTNET_WATCH_RESTART_ON_RUDE_EDIT=1 -export DOTNET_CLI_TELEMETRY_OPTOUT=1 -export DOTNET_ROOT=${pkgs.dotnetCorePackages.sdk_8_0} - -set -x LIBVIRT_DEFAULT_URI qemu:///system - -set -x TERM xterm-256color # ghostty -export SSH_AUTH_SOCK=/home/alex/.bitwarden-ssh-agent.sock # ssh agent - - ''; - }; home.file = { ".config/lazydocker/config.yml".text = '' gui: diff --git a/nix/home-manager/ai-vm.home.nix b/nix/home-manager/ai-vm.home.nix index 9c6a413..63c4e97 100644 --- a/nix/home-manager/ai-vm.home.nix +++ b/nix/home-manager/ai-vm.home.nix @@ -1,5 +1,7 @@ { pkgs, ... }: { + imports = [ ./fish.home.nix ]; + home.packages = with pkgs; [ vscode-fhs gnome-software @@ -38,31 +40,7 @@ package = pkgs.gnome-themes-extra; }; }; - programs.fish = { - enable = true; - shellInit = '' -function commit - git add --all - git commit -m "$argv" - git push -end -# have ctrl+backspace delete previous word -bind \e\[3\;5~ kill-word -# have ctrl+delete delete following word -bind \b backward-kill-word - -set -U fish_user_paths ~/.local/bin $fish_user_paths -#set -U fish_user_paths ~/.dotnet $fish_user_paths -#set -U fish_user_paths ~/.dotnet/tools $fish_user_paths - -export VISUAL=vim -export EDITOR="$VISUAL" -export DOTNET_WATCH_RESTART_ON_RUDE_EDIT=1 -export DOTNET_CLI_TELEMETRY_OPTOUT=1 -set -x LIBVIRT_DEFAULT_URI qemu:///system - ''; - }; home.file = { ".config/lazydocker/config.yml".text = '' gui: diff --git a/nix/home-manager/alex.home.nix b/nix/home-manager/alex.home.nix index 3c3a004..8aa9519 100644 --- a/nix/home-manager/alex.home.nix +++ b/nix/home-manager/alex.home.nix @@ -1,5 +1,10 @@ { pkgs, ... }: { + imports = [ ./fish.home.nix ]; + + customFish = { + bluetuiAliases = true; + }; home.packages = with pkgs; [ k9s jwt-cli @@ -36,37 +41,7 @@ home.sessionVariables = { EDITOR = "vim"; }; - programs.fish = { - enable = true; - shellInit = '' -alias blue="bluetui" -function commit - git add --all - git commit -m "$argv" - git pull - git push -end - -# have ctrl+backspace delete previous word -bind \e\[3\;5~ kill-word -# have ctrl+delete delete following word -bind \b backward-kill-word - -set -U fish_user_paths ~/.local/bin $fish_user_paths -#set -U fish_user_paths ~/.dotnet $fish_user_paths -#set -U fish_user_paths ~/.dotnet/tools $fish_user_paths - -export VISUAL=vim -export EDITOR="$VISUAL" -export DOTNET_WATCH_RESTART_ON_RUDE_EDIT=1 -export DOTNET_CLI_TELEMETRY_OPTOUT=1 -set -x LIBVIRT_DEFAULT_URI qemu:///system - -alias blue="bluetui" -alias jelly="jellyfin-tui" - ''; - }; home.file = { ".config/lazydocker/config.yml".text = '' gui: diff --git a/nix/home-manager/fish.home.nix b/nix/home-manager/fish.home.nix new file mode 100644 index 0000000..04eaef4 --- /dev/null +++ b/nix/home-manager/fish.home.nix @@ -0,0 +1,75 @@ +{ pkgs, lib, config, ... }: + +let + cfg = config.customFish; +in { + options.customFish = { + # Opt-in: only enable if the relevant tools are installed on this machine + + bluetuiAliases = lib.mkEnableOption "bluetui/jellyfin-tui shell aliases"; + + dotnetPackage = lib.mkOption { + type = lib.types.nullOr lib.types.package; + default = null; + description = "Enable dotnet env vars and PATH entries. Set to the desired SDK package (e.g. pkgs.dotnetCorePackages.sdk_8_0)."; + }; + + bitwardenSshAgent = lib.mkEnableOption "Bitwarden SSH agent (sets SSH_AUTH_SOCK)"; + }; + + config = { + programs.fish = { + enable = true; + shellInit = lib.concatStringsSep "\n" (lib.filter (s: s != "") [ + + # https://gist.github.com/thomd/7667642 + '' + export LS_COLORS=':di=95' + + function commit + git add --all + git commit -m "$argv" + for remote in (git remote) + git pull $remote + git push $remote + end + end + + # have ctrl+backspace delete previous word + bind \e\[3\;5~ kill-word + # have ctrl+delete delete following word + bind \b backward-kill-word + set -U fish_user_paths ~/.local/bin ~/bin ~/.dotnet ~/.dotnet/tools $fish_user_paths + set fish_pager_color_selected_background --background='00399c' + + export VISUAL=vim + export EDITOR="$VISUAL" + + set -x LIBVIRT_DEFAULT_URI qemu:///system + set -x TERM xterm-256color + + if test -f "$HOME/.cargo/env.fish" + source "$HOME/.cargo/env.fish" + end + '' + + (lib.optionalString cfg.bluetuiAliases '' + alias blue="bluetui" + alias jelly="jellyfin-tui" + '') + + + (lib.optionalString (cfg.dotnetPackage != null) '' + export DOTNET_WATCH_RESTART_ON_RUDE_EDIT=1 + export DOTNET_CLI_TELEMETRY_OPTOUT=1 + export DOTNET_ROOT=${cfg.dotnetPackage} + '') + + (lib.optionalString cfg.bitwardenSshAgent '' + export SSH_AUTH_SOCK=$HOME/.bitwarden-ssh-agent.sock + '') + + ]); + }; + }; +} diff --git a/nix/home-manager/work.home.nix b/nix/home-manager/work.home.nix index 0069d8b..2593dee 100644 --- a/nix/home-manager/work.home.nix +++ b/nix/home-manager/work.home.nix @@ -8,6 +8,14 @@ let (fetchTarball "https://github.com/nix-community/nixGL/archive/main.tar.gz") { }; in { + imports = [ ./fish.home.nix ]; + + customFish = { + bluetuiAliases = true; + dotnetPackage = pkgs.dotnetCorePackages.sdk_8_0; + bitwardenSshAgent = true; + }; + home.username = "alexm"; home.homeDirectory = "/home/alexm"; nixpkgs.config.allowUnfree = true; @@ -90,47 +98,7 @@ in { window-width = "120"; }; }; - programs.fish = { - enable = true; - shellInit = '' - # https://gist.github.com/thomd/7667642 - export LS_COLORS=':di=95' - function commit - git add --all - git commit -m "$argv" - git pull - git push - end - - # have ctrl+backspace delete previous word - bind \e\[3\;5~ kill-word - # have ctrl+delete delete following word - bind \b backward-kill-word - - alias blue="bluetui" - alias jelly="jellyfin-tui" - - set -U fish_user_paths ~/.local/bin $fish_user_paths - set -U fish_user_paths ~/bin $fish_user_paths - set -U fish_user_paths ~/.dotnet $fish_user_paths - set -U fish_user_paths ~/.dotnet/tools $fish_user_paths - set fish_pager_color_selected_background --background='00399c' - - export VISUAL=vim - export EDITOR="$VISUAL" - export DOTNET_WATCH_RESTART_ON_RUDE_EDIT=1 - export DOTNET_CLI_TELEMETRY_OPTOUT=1 - export DOTNET_ROOT=${pkgs.dotnetCorePackages.sdk_8_0} - - set -x LIBVIRT_DEFAULT_URI qemu:///system - set -x TERM xterm-256color # ghostty - - source "$HOME/.cargo/env.fish" - - export SSH_AUTH_SOCK=/home/alexm/.bitwarden-ssh-agent.sock # ssh agent - ''; - }; home.file = { ".config/lazydocker/config.yml".text = '' gui: From 5a3a8e053d146e1a59d213bb10f2ba75e35c9a1e Mon Sep 17 00:00:00 2001 From: Alex Mickelson Date: Tue, 10 Mar 2026 10:06:29 -0600 Subject: [PATCH 2/2] lazydocker fixed now --- nix/home-manager/work.home.nix | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/nix/home-manager/work.home.nix b/nix/home-manager/work.home.nix index 2593dee..97332f3 100644 --- a/nix/home-manager/work.home.nix +++ b/nix/home-manager/work.home.nix @@ -24,16 +24,16 @@ in { jwt-cli fish kubectl - (lazydocker.overrideAttrs (oldAttrs: rec { - version = "0.24.1"; - src = pkgs.fetchFromGitHub { - owner = "jesseduffield"; - repo = "lazydocker"; - rev = "v${version}"; - hash = "sha256-cVjDdrxmGt+hj/WWP9B3BT739k9SSr4ryye5qWb3XNM="; - }; - })) - # lazydocker + # (lazydocker.overrideAttrs (oldAttrs: rec { + # version = "0.24.4"; + # src = pkgs.fetchFromGitHub { + # owner = "jesseduffield"; + # repo = "lazydocker"; + # rev = "v${version}"; + # hash = "sha256-cW90/yblSLBkcR4ZdtcSI9MXFjOUxyEectjRn9vZwvg="; + # }; + # })) + lazydocker traceroute (with dotnetCorePackages; combinePackages [ sdk_8_0 sdk_9_0 ]) nodejs_22