github.com/replit/upm@v0.0.0-20240423230255-9ce4fc3ea24c/.semaphore/install_nix.sh (about)

     1  #!/usr/bin/env sh
     2  
     3  set -e
     4  set -o xtrace
     5  
     6  install_script_cache_key="install-nix-2.16.1"
     7  install_script="/tmp/$install_script_cache_key"
     8  
     9  # Install Nix. Install the base version if the currently installed version is
    10  # not what we expect.
    11  if [ \
    12  	! -f ~/.nix-profile/etc/profile.d/nix.sh -o \
    13  	"$(~/.nix-profile/bin/nix --version)" != "nix (Nix) 2.16.1" \
    14  	]; then
    15  	curl -L https://releases.nixos.org/nix/nix-2.16.1/install | sh
    16  fi
    17  
    18  source ~/.nix-profile/etc/profile.d/nix.sh
    19  
    20  set +e