From 2870a75178a9da628ea8f85c4aa18eaa797f2b9b Mon Sep 17 00:00:00 2001 From: nomadics9 Date: Sun, 13 Oct 2024 17:20:28 +0300 Subject: [PATCH] installer - Change dotfiles url --- install.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/install.sh b/install.sh index 9e66ff8..8f9d6ba 100755 --- a/install.sh +++ b/install.sh @@ -171,6 +171,28 @@ vfio_response=$(ask_yes_no "Do you want GPU-Passthrough to be enabled") sed -i "s/common.services.vfio.enable = .*/common.services.vfio.enable = $vfio_response;/" "$config_file" +echo -e "$YELLOW If you want to use your repo make sure to fork mine to keep the same structure for hyprland stuff $ENDCOLOR" +read -p "Do you have a dotfiles URL? (y/n): " has_dotfiles +if [[ "$has_dotfiles" == "y" || "$has_dotfiles" == "yes" ]]; then + read -p "Please paste the dotfiles URL: " dotfiles_url + + # Check if dotfiles URL is valid (basic check for http or git protocol) + if [[ "$dotfiles_url" =~ ^(http|https|git):// ]]; then + echo "Updating flake.nix with the new dotfiles URL..." + + # Use sed to replace the existing dotfiles URL with the new one + sed -i "/dotfiles = {/,/};/s|url = \".*\";|url = \"$dotfiles_url\";|" "$flake_file" + sleep 0.3 + nix flake lock --update-input dotfiles + echo "flake.nix updated successfully!" + else + echo "Invalid URL format. Please make sure to enter a valid git URL." + fi +else + echo "Skipping dotfiles URL update." +fi + + # Notify the user that the changes are complete echo -e "$GREEN Configuration has been updated with your preferences $ENDCOLOR"