diff --git a/infra/setup/bin/backup_file b/infra/setup/bin/backup_file index 3b62026e7..051dd4d6c 100755 --- a/infra/setup/bin/backup_file +++ b/infra/setup/bin/backup_file @@ -13,9 +13,10 @@ source "$DOTFILES/infra/scripts/prompts.sh" # - {string} [extension = bak] - extension of created file, default of bak backup_file() { # parameters - local src="$1" ext="$2" + local src="$1" ext="${2:-bak}" [ -f "$src" ] && { + # TODO: conditionally use sudo here sudo mv "$src" "$src.$ext" } } diff --git a/infra/setup/bin/setup_nix b/infra/setup/bin/setup_nix index d3b2badbe..8bf67d698 100755 --- a/infra/setup/bin/setup_nix +++ b/infra/setup/bin/setup_nix @@ -172,13 +172,13 @@ maybe_install_nix_darwin() { nix-build https://github.com/LnL7/nix-darwin/archive/master.tar.gz -A installer - backup_default_system_files + # backup_default_system_files # TODO: handle interactive prompts, pass flags to answer questions? source "${TMPDIR}/result/bin/darwin-installer" || { fail '`nix-darwin` installer failed. Please fix any issues and try again.' - restore_default_system_files + # restore_default_system_files return 1 }