mirror of
https://github.com/digital-asset/daml.git
synced 2024-11-10 10:46:11 +03:00
2c1d4cb805
Nix now requires -L, I’ve gone ahead and just normalized everything to use -sfL which we were already using in one place. changelog_begin changelog_end
26 lines
659 B
Bash
26 lines
659 B
Bash
#!/usr/bin/env bash
|
|
# source this file to check that nix is installed
|
|
#
|
|
# if nix is installed as a user profile, it will also load the nix profile
|
|
|
|
ensure_nix() {
|
|
local nix_profile=$HOME/.nix-profile/etc/profile.d/nix.sh
|
|
if type -p nix &>/dev/null; then
|
|
return
|
|
fi
|
|
|
|
# shellcheck disable=SC1090
|
|
[[ -f "$nix_profile" ]] && source "$nix_profile"
|
|
|
|
if type -p nix &>/dev/null; then
|
|
return
|
|
fi
|
|
|
|
echo "[dev-env] Nix is not installed on your machine." >&2
|
|
echo "[dev-env] Run \`bash <(curl -sSfL https://nixos.org/nix/install)\`" >&2
|
|
return 1
|
|
}
|
|
|
|
: "${MANPATH:=}" # Nix 2.x profile fails if `set -e` is active otherwise.
|
|
ensure_nix || exit 1
|