···11+# Plugin fzf
22+set -l plugin_dir /nix/store/72ir6g2b07ad0ydx6zg5gg6zxil6zysr-source
33+44+# Set paths to import plugin components
55+if test -d $plugin_dir/functions
66+ set fish_function_path $fish_function_path[1] $plugin_dir/functions $fish_function_path[2..-1]
77+end
88+99+if test -d $plugin_dir/completions
1010+ set fish_complete_path $fish_complete_path[1] $plugin_dir/completions $fish_complete_path[2..-1]
1111+end
1212+1313+# Source initialization code if it exists.
1414+if test -d $plugin_dir/conf.d
1515+ for f in $plugin_dir/conf.d/*.fish
1616+ source $f
1717+ end
1818+end
1919+2020+if test -f $plugin_dir/key_bindings.fish
2121+ source $plugin_dir/key_bindings.fish
2222+end
2323+2424+if test -f $plugin_dir/init.fish
2525+ source $plugin_dir/init.fish
2626+end
···11+# Plugin z
22+set -l plugin_dir /nix/store/8hn5ikk3inzalkidr3r9np29bmm0qvxm-source
33+44+# Set paths to import plugin components
55+if test -d $plugin_dir/functions
66+ set fish_function_path $fish_function_path[1] $plugin_dir/functions $fish_function_path[2..-1]
77+end
88+99+if test -d $plugin_dir/completions
1010+ set fish_complete_path $fish_complete_path[1] $plugin_dir/completions $fish_complete_path[2..-1]
1111+end
1212+1313+# Source initialization code if it exists.
1414+if test -d $plugin_dir/conf.d
1515+ for f in $plugin_dir/conf.d/*.fish
1616+ source $f
1717+ end
1818+end
1919+2020+if test -f $plugin_dir/key_bindings.fish
2121+ source $plugin_dir/key_bindings.fish
2222+end
2323+2424+if test -f $plugin_dir/init.fish
2525+ source $plugin_dir/init.fish
2626+end
+131
private_dot_config/private_fish/config.fish
···11+# Only execute this file once per shell.
22+set -q __fish_home_manager_config_sourced; and exit
33+set -g __fish_home_manager_config_sourced 1
44+55+source /nix/store/pyfj0gysbagb9g8w4q98fl0hf603ygfa-hm-session-vars.fish
66+77+88+99+1010+status is-login; and begin
1111+1212+ # Login shell initialisation
1313+1414+1515+end
1616+1717+status is-interactive; and begin
1818+1919+ # Abbreviations
2020+2121+2222+ # Aliases
2323+ alias che chezmoi
2424+ alias gb 'git branch'
2525+ alias gca 'git commit --amend'
2626+ alias gchd 'git checkout develop'
2727+ alias gchm 'git checkout main'
2828+ alias gcho 'git checkout'
2929+ alias gcnv 'git commit --no-verify'
3030+ alias gd 'git diff'
3131+ alias gdc 'git diff --cached'
3232+ alias gdt 'git diff-tree --no-commit-id --name-only -r'
3333+ alias gf 'git fetch'
3434+ alias gl 'git pull'
3535+ alias gm 'git merge'
3636+ alias gp 'git push'
3737+ alias gpuoh 'git push --set-upstream origin HEAD'
3838+ alias gr 'git remote'
3939+ alias gra 'git remote add'
4040+ alias grr 'git remote remove'
4141+ alias grv 'git remote -v'
4242+ alias gs 'git status'
4343+ alias ngoose 'nix-shell -p uv --run '\''goose session'\'''
4444+ alias nv nvim
4545+ alias yay paru
4646+4747+ # Interactive shell initialisation
4848+ fish_config theme choose rose-pine-moon
4949+ set fish_greeting # Disable greeting
5050+ export NIX_LD=$(nix eval --impure --raw --expr 'let pkgs = import <nixpkgs> {}; NIX_LD = pkgs.lib.fileContents "/nix/store/mzfk1sdv6bxvdh9slvddpj734ck99idi-gcc-wrapper-13.3.0/nix-support/dynamic-linker"; in NIX_LD ')
5151+ test -f ~/.config/myvars; and source ~/.config/myvars
5252+ test -f /run/current-system/sw/share/autojump/autojump.fish; and source /run/current-system/sw/share/autojump/autojump.fish
5353+ test -f /home/thomasgl/.nix-profile/share/autojump/autojump.fish; and source /home/thomasgl/.nix-profile/share/autojump/autojump.fish
5454+ test -f ~/.env; and source ~/.env
5555+5656+5757+ nerdfetch
5858+5959+ if test "$TERM" != dumb
6060+ eval (/home/thomasgl/.nix-profile/bin/starship init fish)
6161+6262+ end
6363+6464+ # add completions generated by Home Manager to $fish_complete_path
6565+ begin
6666+ set -l joined (string join " " $fish_complete_path)
6767+ set -l prev_joined (string replace --regex "[^\s]*generated_completions.*" "" $joined)
6868+ set -l post_joined (string replace $prev_joined "" $joined)
6969+ set -l prev (string split " " (string trim $prev_joined))
7070+ set -l post (string split " " (string trim $post_joined))
7171+ set fish_complete_path $prev "/home/thomasgl/.local/share/fish/home-manager_generated_completions" $post
7272+ end
7373+7474+7575+end
7676+7777+# pnpm
7878+set -gx PNPM_HOME "/home/thomasgl/.local/share/pnpm"
7979+if not string match -q -- $PNPM_HOME $PATH
8080+ set -gx PATH "$PNPM_HOME" $PATH
8181+end
8282+# pnpm end
8383+8484+8585+8686+if not set -q SSH_AUTH_SOCK
8787+ # Check if ssh-agent is already running and accessible
8888+ set -l agent_pid (pgrep ssh-agent | head -n 1)
8989+9090+ if test -n "$agent_pid"
9191+ # Try to find existing socket
9292+ set -l sock_path (find /tmp -name "ssh-*" -type d 2>/dev/null | \
9393+ xargs -I {} find {} -name "agent.*" 2>/dev/null | head -n 1)
9494+9595+ if test -n "$sock_path"
9696+ set -gx SSH_AUTH_SOCK "$sock_path"
9797+ set -gx SSH_AGENT_PID "$agent_pid"
9898+9999+ # Test if agent is responsive
100100+ if ssh-add -l >/dev/null 2>&1
101101+ # echo "Connected to existing ssh-agent (PID: $agent_pid)"
102102+ return 0
103103+ else
104104+ # Clean up stale variables
105105+ set -e SSH_AUTH_SOCK SSH_AGENT_PID
106106+ end
107107+ end
108108+ end
109109+110110+ # Start new ssh-agent
111111+ # echo "Starting new ssh-agent..."
112112+ set -l agent_output (ssh-agent -c)
113113+114114+ # Parse output and set variables
115115+ for line in $agent_output
116116+ if string match -qr '^setenv SSH_AUTH_SOCK' "$line"
117117+ set -gx SSH_AUTH_SOCK (string replace -r '^setenv SSH_AUTH_SOCK (.+);$' '$1' "$line" | string trim -c '"')
118118+ else if string match -qr '^setenv SSH_AGENT_PID' "$line"
119119+ set -gx SSH_AGENT_PID (string replace -r '^setenv SSH_AGENT_PID (.+);$' '$1' "$line" | string trim -c '"')
120120+ end
121121+ end
122122+123123+ # Verify agent started successfully
124124+ if test -z "$SSH_AUTH_SOCK" -o -z "$SSH_AGENT_PID"
125125+ # echo "Error: Failed to start ssh-agent" >&2
126126+ return 1
127127+ end
128128+129129+ # echo "ssh-agent started (PID: $SSH_AGENT_PID)"
130130+end
131131+
···11+22+33+#!/bin/bash
44+55+# Directory to process
66+TARGET_DIR="/home/thomasgl/.config/fish-backup" # Make sure this is the correct, full path
77+88+# Check if the directory exists
99+if [ ! -d "$TARGET_DIR" ]; then
1010+ echo "Error: Directory '$TARGET_DIR' not found."
1111+ exit 1
1212+fi
1313+1414+# Find symlinks and process them
1515+find "$TARGET_DIR" -type l -print0 | while IFS= read -r -d $'\0' SYMLINK; do
1616+ echo "Processing symlink: $SYMLINK"
1717+1818+ # Get the target of the symlink
1919+ TARGET=$(readlink "$SYMLINK")
2020+2121+ # Check if readlink was successful and the target exists
2222+ if [ $? -eq 0 ] && [ -e "$TARGET" ]; then
2323+ echo " Target: $TARGET"
2424+2525+ # *** Explicitly remove the symlink BEFORE copying ***
2626+ echo " Removing symlink: $SYMLINK"
2727+ rm "$SYMLINK"
2828+2929+ # Check if removal was successful
3030+ if [ $? -eq 0 ]; then
3131+ # Copy the target file to the location where the symlink was
3232+ echo " Copying target to $SYMLINK"
3333+ cp "$TARGET" "$SYMLINK"
3434+3535+ if [ $? -eq 0 ]; then
3636+ echo " Replaced symlink with a copy of the target."
3737+ else
3838+ echo " Error: Failed to copy target to $SYMLINK."
3939+ fi
4040+ else
4141+ echo " Error: Failed to remove symlink: $SYMLINK. Cannot proceed with copy."
4242+ fi
4343+4444+ else
4545+ echo " Warning: Could not resolve target for '$SYMLINK' or target does not exist."
4646+ fi
4747+done
4848+4949+echo "Processing complete."