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.

Revisions

  1. pascualmg renamed this gist Feb 2, 2024. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. pascualmg created this gist Feb 2, 2024.
    31 changes: 31 additions & 0 deletions uninstall_nix_from_macos.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    #!/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."