Skip to content

Commit

Permalink
fish: {user,vim}_setup: Use relative symlinks for configuration files
Browse files Browse the repository at this point in the history
If running in a container like systemd-nspawn, which mounts the user's
home folder to /run/host/home/<user> instead of /home/<user>, the
absolute symlinks will not resolve correctly.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
  • Loading branch information
nathanchance committed Dec 20, 2024
1 parent 3f64e10 commit 1a7f927
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions fish/functions/user_setup.fish
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ function user_setup -d "Setup a user account, downloading all files and placing
# config.fish
rm -rf $__fish_config_dir/config.fish
ln -fsv $ENV_FOLDER/fish/config.fish $__fish_config_dir/config.fish
ln -frsv $ENV_FOLDER/fish/config.fish $__fish_config_dir/config.fish
# Global .gitignore
set gitignore $HOME/.gitignore_global
Expand Down Expand Up @@ -261,9 +261,9 @@ rpmbuild/' >>$gitignore
# Configuration files (vim, tmux, etc)
set configs $ENV_FOLDER/configs
ln -fsv $configs/tmux/.tmux.conf $HOME/.tmux.conf
ln -frsv $configs/tmux/.tmux.conf $HOME/.tmux.conf
mkdir -p $HOME/.config/tio
ln -fsv $configs/local/tio $HOME/.config/tio/config
ln -frsv $configs/local/tio $HOME/.config/tio/config
vim_setup
# Terminal profiles
Expand All @@ -280,14 +280,14 @@ rpmbuild/' >>$gitignore
if is_installed konsole
set konsole_share $HOME/.local/share/konsole
mkdir -p $konsole_share
ln -fsv $configs/local/Nathan.profile $konsole_share/Nathan.profile
ln -fsv $configs/local/snazzy.colorscheme $konsole_share/snazzy.colorscheme
ln -frsv $configs/local/Nathan.profile $konsole_share/Nathan.profile
ln -frsv $configs/local/snazzy.colorscheme $konsole_share/snazzy.colorscheme
end
if is_installed xfce4-terminal
set xfce_share $HOME/.local/share/xfce4/terminal/colorschemes
mkdir -p $xfce_share
ln -fsv $configs/local/snazzy.theme $xfce_share
ln -frsv $configs/local/snazzy.theme $xfce_share
end
end
Expand Down
4 changes: 2 additions & 2 deletions fish/functions/vim_setup.fish
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ function vim_setup -d "Setup vim configuration files"
test -L $dest; and continue

mkdir -p (dirname $dest)
ln -fsv $env_vim/$folder $dest
ln -frsv $env_vim/$folder $dest
end

# Install .vimrc
ln -fsv $env_vim/.vimrc $HOME/.vimrc
ln -frsv $env_vim/.vimrc $HOME/.vimrc

# Download and update plugins
upd vim
Expand Down

0 comments on commit 1a7f927

Please sign in to comment.