···11-# -----------------------------------------------------
22-# Fish Configuration
33-# -----------------------------------------------------
44-55-# This file is created once, you can edit here and it won't be in conflict with chezmoi
66-77-set fish_greeting ""
88-# Load modular Fish configuration files
99-for file in ~/.config/fish/config/*.fish
1010- if test -f $file
1111- source $file
1212- end
1313-end
-48
configs/fish/config/00-init.fish
···11-# Set PATH
22-set -x PATH /usr/lib/ccache/bin /snap/bin $HOME/bin $HOME/.local/bin/mini $HOME/.bun/bin $PATH
33-44-# # Set history file location
55-# set -x fish_history "$HOME/.local/share/fish/fish_history"
66-77-# Set history size
88-set -x fish_history_size 10000
99-1010-# -----------------------------------------------------
1111-# INIT
1212-# -----------------------------------------------------
1313-1414-# Exporting EDITOR
1515-# On Debian, add nvim to path
1616-if test -f /etc/debian_version
1717- set -x PATH $PATH /opt/nvim-linux64/bin
1818-end
1919-set -x USERTERM $TERM
2020-if test -n "$WSL_INTEROP"
2121- set -x USERTERM "$TERM-wsl"
2222-end
2323-2424-# Heartbreaking: Mise no longer important as package manager in Nix-configs.
2525-# mise activate fish | source
2626-2727-2828-set -x EDITOR nvim
2929-set -x VISUAL nvim
3030-if set -q ZED_TERM
3131- set -x EDITOR zeditor
3232- set -x VISUAL zeditor
3333- set -x JJ_EDITOR 'zeditor --wait'
3434-end
3535-# # On local machines, excluding on Niri (it doesn't need Muxing) or inside toolbx (because it's going to stack)
3636-# if status is-interactive; and not set -q TOOLBOX_NAME; and not set -q NIRI_SOCKET; and not set -q SSH_CONNECTION
3737-# set ZELLIJ_AUTO_EXIT true
3838-# eval (zellij setup --generate-auto-start fish | string collect)
3939-# end
4040-4141-# On SSH connections, we want a slightly different approach.
4242-if status is-interactive; and set -q SSH_CONNECTION
4343- set ZELLIJ_AUTO_ATTACH true
4444- set ZELLIJ_AUTO_EXIT true
4545- eval (zellij setup --generate-auto-start fish | string collect)
4646-end
4747-4848-direnv hook fish | source
-45
configs/fish/config/10-customization.fish
···11-# -----------------------------------------------------
22-# Customization
33-# -----------------------------------------------------
44-55-# Initialize Starship prompt
66-starship init fish | source
77-88-# Enhanced completion options
99-# Fish handles completions differently, so no direct translation is needed.
1010-1111-# Directory navigation aliases
1212-alias .. 'cd ..'
1313-alias ... 'cd ../..'
1414-alias .... 'cd ../../..'
1515-alias ..... 'cd ../../../..'
1616-1717-# -----------------------------------------------------
1818-# Clipboard utilities
1919-# -----------------------------------------------------
2020-if type -q xclip
2121- alias pbcopy 'xclip -selection clipboard'
2222- alias pbpaste 'xclip -selection clipboard -o'
2323-else if type -q xsel
2424- alias pbcopy 'xsel --clipboard --input'
2525- alias pbpaste 'xsel --clipboard --output'
2626-else if type -q wl-copy
2727- alias pbcopy 'wl-copy'
2828- alias pbpaste 'wl-paste'
2929-end
3030-3131-function copyfile
3232- if test -f $argv[1]
3333- cat $argv[1] | pbcopy
3434- echo "File $argv[1] copied to clipboard"
3535- else
3636- echo "File $argv[1] not found"
3737- end
3838-end
3939-4040-function copybuffer
4141- echo $argv | pbcopy
4242- echo "Command line copied to clipboard"
4343-end
4444-4545-set -x GIT_EXTERNAL_DIFF difft
-146
configs/fish/config/20-aliases.fish
···11-# -----------------------------------------------------
22-# Aliases
33-# -----------------------------------------------------
44-55-# General aliases
66-alias cls clear
77-alias ls 'eza --icons'
88-alias la 'eza -a --icons'
99-alias ll 'eza -al --icons'
1010-alias lt 'eza -a --tree --level=1 --icons'
1111-alias v '$EDITOR'
1212-alias cat 'bat -p'
1313-alias zed 'ZED_ALLOW_EMULATED_GPU=1 SHELL=$(which fish) zeditor'
1414-alias to-dotfiles "cd ~/.dotfiles || cd ~/dotfiles"
1515-alias strider 'zellij plugin --in-place -- zellij:strider'
1616-1717-# -----------------------------------------------------
1818-# Directory navigation and aliases
1919-# -----------------------------------------------------
2020-zoxide init fish --cmd zox | source
2121-2222-function zap
2323- if test -d .jj; or test -d .git
2424- clear -x
2525- set -l repo_type ""
2626- if test -d .git -a -d .jj
2727- set repo_type "JJ (git-colocated)"
2828- else if test -d .jj
2929- set repo_type Jujutsu
3030- else
3131- set repo_type Git
3232- end
3333-3434- echo "📂 Opened $repo_type repository: $(pwd)"
3535-3636- if test -d .git
3737- git fetch
3838- else
3939- jj git fetch
4040- end
4141- # Show repository line counts
4242- kc
4343-4444- if test -d .jj
4545- jj log -Tbuiltin_log_compact_full_description -r'ancestors(bookmarks() & @-, 5) & ~@' --reversed --no-pager --limit 5
4646- jj show --summary
4747- else
4848- git status
4949- end
5050-5151- # Show repository filetree
5252- # eza --icons -L 2 -R --tree --git-ignore # Disabled. Output gets too long.
5353-5454- # Dynamically tell user of flakes.
5555- if test -f flake.nix; and type -q nix; and not set -q IN_NIX_SHELL; and not test -f .envrc
5656- echo -e "\n\n❄️\tFound flake.nix, run 'create-envrc' to create a .envrc file here to load this flake automatically."
5757- echo -e "\tOr alternatively, run 'dev' to open Fish in a nix develop shell."
5858- end
5959- else
6060- eza -a --icons
6161- end
6262-end
6363-6464-6565-function dev
6666- if set -q IN_NIX_SHELL
6767- echo "⚠️ Already inside Nix shell!"
6868- return 0
6969- end
7070- if test -f .envrc
7171- echo "⚠️ .envrc found, direnv will be used."
7272- direnv allow
7373- return 0
7474- end
7575- if test -f flake.nix; and type -q nix
7676- nix develop --set-env-var SHELL $SHELL -c $SHELL
7777- else if not type -q nix
7878- echo " Nix is not installed!"
7979- else
8080- echo "❌ No Flake.nix file in this directory"
8181- end
8282-end
8383-8484-function create-envrc
8585- if test -f .envrc
8686- echo "⚠️ .envrc already here, can't safely insert."
8787- return 0
8888- end
8989- if test -f flake.nix; and type -q nix and
9090- type -q direnv
9191- if not test -f .gitignore; or not grep -q "^\.direnv/" .gitignore
9292- echo -e "\n# Ignore direnv cache\n.direnv/" >>.gitignore
9393- end
9494- echo "if nix flake show &> /dev/null; then
9595- use flake
9696- fi" >./.envrc
9797- direnv allow
9898- else if not type -q direnv
9999- echo " Direnv is not installed!"
100100- else if not type -q nix
101101- echo " Nix is not installed!"
102102- else
103103- echo "❌ No Flake.nix file in this directory"
104104- end
105105-end
106106-107107-# Wrap functionality around zoxide's (bang)
108108-function banger
109109- zox $argv; and zap
110110-end
111111-112112-function bangeri
113113- zoxi $argv; and zap
114114-end
115115-116116-alias cd banger
117117-alias cdi bangeri
118118-119119-# abbreviations
120120-abbr nsn 'nix shell nixpkgs#'
121121-abbr nixpkgs 'nix search nixpkgs'
122122-abbr shutdown 'systemctl poweroff'
123123-# Rebuild nix config
124124-abbr rb 'to-dotfiles && jj file track . && doas env PATH=$PATH nixos-rebuild switch --flake .#(hostname) && niri validate'
125125-# Zellij aliases and completion
126126-# zellij setup --generate-completion fish | source
127127-abbr ide 'zellij --layout ide'
128128-# JJ-related abbreviations and aliases
129129-abbr jje 'jj edit'
130130-# ===================================================== --> Please do not break
131131-alias jjd 'jj desc @ -m "
132132-133133-134134-Signed-off-by: $(git config user.name) <$(git config user.email)>" && jj desc @ && jj sign -r @'
135135-# ===================================================== --> Please do not break
136136-function jjdm
137137- jj desc @ -m "$argv
138138-139139-140140-Signed-off-by: $(git config user.name) <$(git config user.email)>" && jj sign -r @
141141-end
142142-abbr jjda 'jj describe @ -m "$(date)"'
143143-abbr jjs 'jj show'
144144-abbr jjn 'jj next --edit'
145145-# Cargo-related abbreviations
146146-abbr cargock 'cargo-clean-all --keep-days 21 ~ -i'
-94
configs/fish/config/30-autostart.fish
···11-# -----------------------------------------------------
22-# Autostart
33-# -----------------------------------------------------
44-55-# Hyfetch
66-if status is-interactive
77- if not set -q HYFETCH_DONE; and not set -q IN_NIX_SHELL
88- # set up (cat /proc/uptime | awk '{print $1}')
99- # set up (string split -r '.' $up)[1]
1010- # if test $up -lt 300
1111- # Alleen draaien als we niet in een subshell zitten en hyfetch nog niet is geweest
1212-1313- set -g HYFETCH_DONE 1
1414- if test -f /etc/os-release; and grep -q '^VARIANT_ID=silverblue$' /etc/os-release
1515- # Hyfetch incorrectly sees silverblue as normal Fedora
1616- hyfetch --distro=silverblue
1717- else
1818- # On all other systems (Fedora Workstation, Ubuntu, macOS, etc.)
1919- # or if the file doesn't exist, run the default.
2020- hyfetch
2121- end
2222-end
2323-end
2424-2525-# Bitwarden session setup
2626-# Only run in interactive shells
2727-if type -q bw && status is-interactive
2828- set BW_PASSWORD_FILE "$HOME/.bitwarden_password"
2929- set BW_SESSION_FILE "$HOME/.cache/bw-session"
3030-3131- function bw_unlock_with_password_file
3232- if test -f "$BW_PASSWORD_FILE"
3333- set BW_SESSION "$(bw unlock --passwordfile "$BW_PASSWORD_FILE" --raw 2>/dev/null)"
3434- if test -n "$BW_SESSION"
3535- mkdir -p (dirname "$BW_SESSION_FILE")
3636- echo "$BW_SESSION" >"$BW_SESSION_FILE"
3737- chmod 600 "$BW_SESSION_FILE"
3838- set -Ux BW_SESSION "$BW_SESSION"
3939- return 0
4040- else
4141- rm -f "$BW_PASSWORD_FILE"
4242- return 1
4343- end
4444- else
4545- echo "Bitwarden password file not found. Set up automatic unlock? (y/N): "
4646- read response
4747- if test "$response" = y -o "$response" = Y
4848- echo "Enter your Bitwarden master password: "
4949- read -s -l password
5050-5151- set BW_SESSION "$(echo "$password" | bw unlock --raw 2>/dev/null)"
5252- if test -n "$BW_SESSION"
5353- echo "$password" >"$BW_PASSWORD_FILE"
5454- chmod 600 "$BW_PASSWORD_FILE"
5555-5656- mkdir -p (dirname "$BW_SESSION_FILE")
5757- echo "$BW_SESSION" >"$BW_SESSION_FILE"
5858- chmod 600 "$BW_SESSION_FILE"
5959-6060- bw sync --session "$BW_SESSION" >/dev/null 2>&1
6161-6262- set -Ux BW_SESSION "$BW_SESSION"
6363- echo "Password saved securely. Future shell sessions will unlock automatically."
6464- return 0
6565- else
6666- echo "Invalid password. Bitwarden will remain locked."
6767- return 1
6868- end
6969- else
7070- echo "Skipping Bitwarden setup."
7171- return 1
7272- end
7373- end
7474- end
7575-7676- if test -f "$BW_SESSION_FILE"
7777- set BW_SESSION "$(cat "$BW_SESSION_FILE")"
7878- if not bw status --session "$BW_SESSION" | grep -q '"status":"unlocked"'
7979- rm -f "$BW_SESSION_FILE"
8080- set -e BW_SESSION
8181- else
8282- set -Ux BW_SESSION "$BW_SESSION"
8383- end
8484- end
8585-8686- if test -z "$BW_SESSION"
8787- set bw_status (bw status 2>/dev/null || echo '{"status":"unauthenticated"}')
8888- if echo "$bw_status" | grep -q '"status":"locked"'
8989- bw_unlock_with_password_file
9090- else if echo "$bw_status" | grep -q '"status":"unauthenticated"'
9191- echo "Bitwarden not logged in. Run 'bw login' first."
9292- end
9393- end
9494-end
-161
configs/fish/config/40-bitwarden-functions.fish
···11-# -----------------------------------------------------
22-# Bitwarden Shell Functions
33-# -----------------------------------------------------
44-55-# Convenient wrapper functions for Bitwarden CLI
66-if type -q bw
77- # Quick Bitwarden functions
88- function bw-get
99- set item_name $argv[1]
1010- set field (or $argv[2] "password")
1111-1212- if not bw-ensure-session
1313- echo "Cannot access Bitwarden vault"
1414- return 1
1515- end
1616-1717- set item_id "$(bw list items --search "$item_name" | jq -r '.[0].id // empty')"
1818- if test -n "$item_id"
1919- bw get "$field" "$item_id" ^ /dev/null
2020- else
2121- echo "Item '$item_name' not found in Bitwarden vault"
2222- return 1
2323- end
2424- end
2525-2626- function bw-login
2727- set email (or $BW_EMAIL "")
2828- if test -z "$email"
2929- echo -n "Enter your Bitwarden email: "
3030- read -l email
3131- end
3232-3333- if test -n "$BW_SERVER"
3434- bw config server "$BW_SERVER"
3535- end
3636-3737- echo "Logging in to Bitwarden..."
3838- if not bw login "$email"
3939- echo "Failed to login to Bitwarden"
4040- return 1
4141- end
4242- end
4343-4444- function bw-unlock
4545- set password_file "$HOME/.bitwarden_password"
4646-4747- if test -f "$password_file"
4848- set session "$(bw unlock --passwordfile "$password_file" --raw)"
4949- if test -n "$session"
5050- set -Ux BW_SESSION "$session"
5151- return 0
5252- else
5353- echo "Password file seems invalid, removing it"
5454- rm -f "$password_file"
5555- end
5656- end
5757-5858- echo -n "Enter your Bitwarden master password: "
5959- read -s -l password
6060-6161- set session "$(echo "$password" | bw unlock --raw)"
6262- if test -n "$session"
6363- echo "$password" > "$password_file"
6464- chmod 600 "$password_file"
6565- set -Ux BW_SESSION "$session"
6666- echo "Bitwarden vault unlocked successfully"
6767- return 0
6868- else
6969- echo "Failed to unlock Bitwarden vault - incorrect password"
7070- return 1
7171- end
7272- end
7373-7474- # Load existing session
7575- function bw-load-session
7676- set session_file "$HOME/.cache/bw-session"
7777- if test -f "$session_file"
7878- set session_token "$(cat "$session_file")"
7979- if test -n "$session_token" && bw list items --search "" >/dev/null
8080- set -Ux BW_SESSION "$session_token"
8181- return 0
8282- else
8383- rm -f "$session_file"
8484- end
8585- end
8686- return 1
8787- end
8888-8989- # Ensure we have a valid Bitwarden session
9090- function bw-ensure-session
9191- # Only try to load session in interactive shells
9292- if not status is-interactive
9393- return 1
9494- end
9595-9696- if bw-load-session
9797- return 0
9898- end
9999-100100- if not bw status | grep -q '"status":"unlocked"'
101101- if bw status | grep -q '"status":"locked"'
102102- bw-unlock
103103- else
104104- bw-login && bw-unlock
105105- end
106106- else
107107- bw-load-session || bw-unlock
108108- end
109109- end
110110-111111- # Copy secret to clipboard (requires xclip/pbcopy)
112112- function bw-copy
113113- set secret (bw-get $argv[1])
114114- if test "$secret" != "Not found" -a "$secret" != "BW_NOT_AVAILABLE"
115115- if type -q xclip
116116- echo "$secret" | xclip -selection clipboard
117117- echo "Secret copied to clipboard"
118118- else if type -q pbcopy
119119- echo "$secret" | pbcopy
120120- echo "Secret copied to clipboard"
121121- else
122122- echo "Clipboard utility not available. Secret: $secret"
123123- end
124124- else
125125- echo "Secret not found: $argv[1]"
126126- end
127127- end
128128-129129- # Generate and copy a random password
130130- function bw-generate
131131- set length (or $argv[1] 20)
132132- if type -q bw
133133- set password (bw generate --length "$length")
134134- if type -q xclip
135135- echo "$password" | xclip -selection clipboard
136136- echo "Generated password copied to clipboard"
137137- else if type -q pbcopy
138138- echo "$password" | pbcopy
139139- echo "Generated password copied to clipboard"
140140- else
141141- echo "Generated password: $password"
142142- end
143143- end
144144- end
145145-146146- # Template helper: get secret for use in chezmoi templates
147147- function bw-template-helper
148148- set item_name $argv[1]
149149- set field (or $argv[2] "password")
150150-151151- if not type -q bw
152152- echo "BW_NOT_AVAILABLE"
153153- return 0
154154- end
155155-156156- if not bw-get-secret "$item_name" "$field" ^ /dev/null
157157- echo "BW_SECRET_NOT_FOUND"
158158- return 0
159159- end
160160- end
161161-end
···2233{
44 home.packages = with pkgs; [
55- fluffychat
55+ cinny-desktop
66 # ... unbridged signal again after the people decided I should
77 signal-desktop
88 ];
···1111 programs.mise = {
1212 enable = false;
1313 enableZshIntegration = false;
1414- enableFishIntegration = false;
1514 };
1615 home.packages = with pkgs; [
1716 # Mise is being faded out in favor of just due to growing friction between me and Mise's style