Fix
This commit is contained in:
11
flake.nix
11
flake.nix
@@ -179,25 +179,30 @@
|
||||
DOTFILES_DIR="$HOME/.config/dotfiles"
|
||||
|
||||
if [ ! -d "$DOTFILES_DIR/.git" ]; then
|
||||
echo "No local repository so cloning from remote"
|
||||
SOURCE="https://labs.scarif.space/chris/dotfiles.git"
|
||||
${pkgs.git}/bin/git clone -b main "$SOURCE" "$TEMP_DIR"
|
||||
mv "$TEMP_DIR/.git" "$DOTFILES_DIR/.git"
|
||||
else
|
||||
echo "Local repository found so cloning from there"
|
||||
SOURCE="$DOTFILES_DIR/.git"
|
||||
${pkgs.git}/bin/git clone -b main "$SOURCE" "$TEMP_DIR"
|
||||
fi
|
||||
|
||||
echo "Copying dot files to home"
|
||||
${pkgs.coreutils}/bin/cp -rfT "$TEMP_DIR" "$HOME"
|
||||
|
||||
NVIM_DIR="$HOME/.config/nvim"
|
||||
if [ ! -d "$NVIM_DIR/.git" ]; then
|
||||
${pkgs.git}/bin/git --git-dir="$DOTFILES_DIR" --work-tree="$HOME" submodule set-url ".config/nvim" https://labs.scarif.space/chris/nvim.git
|
||||
${pkgs.git}/bin/git --git-dir="$DOTFILES_DIR" --work-tree="$HOME" submodule update --init
|
||||
${pkgs.git}/bin/git --git-dir="$DOTFILES_DIR" --work-tree="$HOME" submodule set-url ".config/nvim" git@labs.scarif.space:chris/nvim.git
|
||||
echo "Neovim config not initialised so initialising from remote"
|
||||
${pkgs.git}/bin/git --git-dir="$DOTFILES_DIR/.git" --work-tree="$HOME" submodule set-url ".config/nvim" https://labs.scarif.space/chris/nvim.git
|
||||
${pkgs.git}/bin/git --git-dir="$DOTFILES_DIR/.git" --work-tree="$HOME" submodule update --init
|
||||
${pkgs.git}/bin/git --git-dir="$DOTFILES_DIR/.git" --work-tree="$HOME" submodule set-url ".config/nvim" git@labs.scarif.space:chris/nvim.git
|
||||
fi
|
||||
|
||||
cd "$HOME"
|
||||
|
||||
echo "Cleanup"
|
||||
${pkgs.coreutils}/bin/rm -rf "$TEMP_DIR"
|
||||
|
||||
# Add test file with timestamp
|
||||
|
||||
Reference in New Issue
Block a user