diff --git a/.envrc b/.envrc index ff71ed0..e4789ef 100644 --- a/.envrc +++ b/.envrc @@ -36,8 +36,13 @@ if ! which "$0" | grep -q nix; then git checkout flake.lock fi - print 'Installing Nix Profile...' - nf profile install . --profile "$profile" + echo 'Installing Nix Profile...' + if ! nf profile install . --profile "$profile"; then + echo 'Failed to install new Nix profile! Reverting to previous profile...' + git checkout flake.lock + nf profile install . --profile "$profile" + fi + nf profile list --profile "$profile" print 'Starting...'