install: undo mirroring $HOME
This commit is contained in:
parent
8477ec14b8
commit
637fd71e3c
@ -9,7 +9,7 @@ found_nix_command=0
|
|||||||
for profile in "$HOME/.nix-profile" "/nix/var/nix/profiles/default"
|
for profile in "$HOME/.nix-profile" "/nix/var/nix/profiles/default"
|
||||||
do
|
do
|
||||||
if test -x "$profile/bin/nix-env"; then
|
if test -x "$profile/bin/nix-env"; then
|
||||||
"$profile/bin/nix-env" --install --remove-all --file "$ROOTDIR/.config/nix/packages.nix"
|
"$profile/bin/nix-env" --install --remove-all --file "$ROOTDIR/nix/packages.nix"
|
||||||
found_nix_command=1
|
found_nix_command=1
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
@ -7,8 +7,9 @@ ROOTDIR=$(cd "$(dirname "$0")/.." && pwd)
|
|||||||
# Create config directory if not present
|
# Create config directory if not present
|
||||||
mkdir -p "$HOME/.config"
|
mkdir -p "$HOME/.config"
|
||||||
|
|
||||||
for srcdir in $(find "$ROOTDIR/.config" -mindepth 1 -maxdepth 1 -type d); do
|
install_symlink() {
|
||||||
dstdir="$HOME/.config/$(basename $srcdir)"
|
local srcdir="$1"
|
||||||
|
local dstdir="$2"
|
||||||
|
|
||||||
# Backup configs that are not already symlinked
|
# Backup configs that are not already symlinked
|
||||||
if [ -e "$dstdir" ] && [ ! -L "$dstdir" ]; then
|
if [ -e "$dstdir" ] && [ ! -L "$dstdir" ]; then
|
||||||
@ -17,6 +18,12 @@ for srcdir in $(find "$ROOTDIR/.config" -mindepth 1 -maxdepth 1 -type d); do
|
|||||||
|
|
||||||
# Create symlinks, forcing updates
|
# Create symlinks, forcing updates
|
||||||
ln -fnsv "$srcdir" "$dstdir"
|
ln -fnsv "$srcdir" "$dstdir"
|
||||||
done
|
}
|
||||||
|
|
||||||
|
install_symlink "$ROOTDIR/fish" "$HOME/.config/fish"
|
||||||
|
install_symlink "$ROOTDIR/git" "$HOME/.config/git"
|
||||||
|
install_symlink "$ROOTDIR/helix" "$HOME/.config/helix"
|
||||||
|
install_symlink "$ROOTDIR/nix" "$HOME/.config/nix"
|
||||||
|
install_symlink "$ROOTDIR/sbt" "$HOME/.config/sbt"
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
Loading…
x
Reference in New Issue
Block a user