Skip to content

Instantly share code, notes, and snippets.

@pascualmg
Last active February 2, 2024 13:24
Show Gist options
  • Save pascualmg/d22b31369957efe72d947abd5f2ab1df to your computer and use it in GitHub Desktop.
Save pascualmg/d22b31369957efe72d947abd5f2ab1df to your computer and use it in GitHub Desktop.
uninstall nix in macos
#!/bin/bash
if ! command -v curl >/dev/null 2>&1
then
echo "Curl no está instalado. Intentando instalar..."
# Intenta instalar Curl
sudo apt-get install curl
fi
# Verificar si Nix está instalado
if command -v nix >/dev/null 2>&1
then
echo "Nix ya está instalado. No se realizará ninguna acción."
else
if [ -f /etc/bash.bashrc.backup-before-nix ]
then
echo "El archivo /etc/bash.bashrc.backup-before-nix existe."
read -p "¿Deseas eliminar este archivo? [y/N] " respuesta
if [[ $respuesta =~ ^[Yy]$ ]]
then
sudo rm -f /etc/bash.bashrc.backup-before-nix
echo "El archivo /etc/bash.bashrc.backup-before-nix ha sido eliminado."
else
echo "Abortando la instalación de Nix."
exit 1
fi
fi
echo "Nix no está instalado. Iniciando la instalación..."
curl -L https://nixos.org/nix/install | sh -s -- --daemon
echo "Instalación de Nix completada. Activando características experimentales..."
echo "experimental-features : nix-command flakes" >> ~/.config/nix/nix.conf
echo "Características experimentales activadas."
@pascualmg
Copy link
Author

pascualmg commented Feb 2, 2024

install and activate the cool features

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment