chore(bootstrap): Don't use doas on macOS, also install nix on bootstrap
This commit is contained in:
parent
e061a0379f
commit
f3f0d4b23b
1 changed files with 15 additions and 2 deletions
13
bootstrap
13
bootstrap
|
@ -34,8 +34,13 @@ case "$OSTYPE" in
|
||||||
esac
|
esac
|
||||||
[ "$SUDO" = "" ] && {
|
[ "$SUDO" = "" ] && {
|
||||||
FALLBACK_SUDO="sudo"
|
FALLBACK_SUDO="sudo"
|
||||||
|
case $DISTRO in
|
||||||
|
"apple" ) SUDO=$FALLBACK_SUDO ;; # There's no good doas implementation for macOS
|
||||||
|
* )
|
||||||
is_package_exists doas && SUDO="doas" || SUDO=$FALLBACK_SUDO
|
is_package_exists doas && SUDO="doas" || SUDO=$FALLBACK_SUDO
|
||||||
doas echo "" >/dev/null 2>/dev/null || SUDO=$FALLBACK_SUDO
|
doas echo "" >/dev/null 2>/dev/null || SUDO=$FALLBACK_SUDO
|
||||||
|
;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
[ "$PACMAN" = "" ] && {
|
[ "$PACMAN" = "" ] && {
|
||||||
case $DISTRO in
|
case $DISTRO in
|
||||||
|
@ -86,6 +91,11 @@ install_aur_package() {
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
install_nix() {
|
||||||
|
is_package_exists nix && { echo "nix is already installed, skipping..."; return; }
|
||||||
|
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
|
||||||
|
}
|
||||||
|
|
||||||
# === Actual automation ===
|
# === Actual automation ===
|
||||||
|
|
||||||
echo "Linking x* configs..."
|
echo "Linking x* configs..."
|
||||||
|
@ -108,6 +118,9 @@ case $DISTRO in
|
||||||
* ) echo "Not implemented, skipping..." ;;
|
* ) echo "Not implemented, skipping..." ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
echo "Installing nix..."
|
||||||
|
install_nix
|
||||||
|
|
||||||
echo "Changing default shell to zsh..."
|
echo "Changing default shell to zsh..."
|
||||||
$SUDO chsh -s $(which zsh)
|
$SUDO chsh -s $(which zsh)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue