DeterminateSystems / nix-installer

Install Nix and flakes with the fast and reliable Determinate Nix Installer, with over 7 million installs.
https://determinate.systems
GNU Lesser General Public License v2.1
2.18k stars 55 forks source link

<autogenerated-issue> #884

Closed r33drichards closed 1 month ago

r33drichards commented 7 months ago

Error

Error: 
   0: Error reverting
   0: Action `create_or_merge_nix_config` errored
      Remove file `/etc/nix/nix.conf`

Metadata

key value
version 0.17.0
os macos
arch aarch64

robertwendt@Roberts-MacBook-Air darwin % nix-build -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/master.tar.gz https://github.com/LnL7/nix-darwin/archive/master.tar.gz -A uninstaller

warning: ignoring untrusted substituter 'https://digitallyinduced.cachix.org', you are not a trusted user.
Run `man nix.conf` for more information on the `substituters` configuration option.
these 6 derivations will be built:
  /nix/store/qv1gdm70iqjbf59fzn8sykb4p9mmf9ma-darwin-option.drv
  /nix/store/y3m2gkkmxds20m641i9fd3sv2ksj1yyn-darwin-rebuild.drv
  /nix/store/94zfhaca972jv35vj6yszis18z64zlfv-system-applications.drv
  /nix/store/vf8rf2bmvncdlmcwk3kxk0gadgjyx06b-system-path.drv
  /nix/store/50nhaqi0lc3nizdv3czfasvkvaihjpn7-darwin-system-24.05pre-git+darwin4.drv
  /nix/store/3b9qdg67mx2ccbr0y0sfg84y08j4hyf7-darwin-uninstaller.drv
these 2 paths will be fetched (2.83 MiB download, 14.41 MiB unpacked):
  /nix/store/arvf9qp7n0s5a7wqhl1wq5glj3v58ziy-nix-2.18.1
  /nix/store/yn6kmd4z363p001kw1af68izia6gind8-nix-2.18.1-man
copying path '/nix/store/yn6kmd4z363p001kw1af68izia6gind8-nix-2.18.1-man' from 'https://cache.nixos.org'...
copying path '/nix/store/arvf9qp7n0s5a7wqhl1wq5glj3v58ziy-nix-2.18.1' from 'https://cache.nixos.org'...
building '/nix/store/qv1gdm70iqjbf59fzn8sykb4p9mmf9ma-darwin-option.drv'...
building '/nix/store/y3m2gkkmxds20m641i9fd3sv2ksj1yyn-darwin-rebuild.drv'...
building '/nix/store/94zfhaca972jv35vj6yszis18z64zlfv-system-applications.drv'...
building '/nix/store/vf8rf2bmvncdlmcwk3kxk0gadgjyx06b-system-path.drv'...
created 0 symlinks in user environment
created 278 symlinks in user environment
building '/nix/store/50nhaqi0lc3nizdv3czfasvkvaihjpn7-darwin-system-24.05pre-git+darwin4.drv'...
building '/nix/store/3b9qdg67mx2ccbr0y0sfg84y08j4hyf7-darwin-uninstaller.drv'...
Running phase: unpackPhase
Running phase: patchPhase
Running phase: updateAutotoolsGnuConfigScriptsPhase
Running phase: configurePhase
no configure script, doing nothing
Running phase: buildPhase
no Makefile or custom buildPhase, doing nothing
Running phase: installPhase
Running phase: fixupPhase
checking for references to /private/tmp/nix-build-darwin-uninstaller.drv-0/ in /nix/store/q8yq1zy9y7m2ckvalbq4miwklrczjj33-darwin-uninstaller...
patching script interpreter paths in /nix/store/q8yq1zy9y7m2ckvalbq4miwklrczjj33-darwin-uninstaller
stripping (with command strip and flags -S) in  /nix/store/q8yq1zy9y7m2ckvalbq4miwklrczjj33-darwin-uninstaller/bin
/nix/store/q8yq1zy9y7m2ckvalbq4miwklrczjj33-darwin-uninstaller
robertwendt@Roberts-MacBook-Air darwin % ./result/bin/darwin-uninstaller 

Uninstalling nix-darwin, this will:

    - remove /Applications/Nix Apps symlink
    - cleanup static /etc files
    - disable and remove all launchd services managed by nix-darwin
    - restore daemon service from nix installer (only when this is a multi-user install)

Proceed? [y/n] y
user defaults...
setting up user launchd services...
setting up /Applications/Nix Apps...
setting up pam...
applying patches...
setting up /etc...
system defaults...
setting up launchd services...
removing service com.tailscale.tailscaled
removing service org.nixos.activate-system
removing service org.nixos.nix-daemon
configuring networking...
setting nvram variables...
rm: cannot remove '/Library/LaunchDaemons/org.nixos.nix-daemon.plist': No such file or directory
grep: /etc/bashrc: No such file or directory
Found no nix-daemon.sh reference in /etc/bashrc
add this snippet back to /etc/bashrc:

    # Nix
    if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
      . '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
    fi
    # End Nix

NOTE: The /nix/var/nix/profiles/system* profiles still exist and won't be garbage collected.

Done!

robertwendt@Roberts-MacBook-Air darwin % /nix/nix-installer uninstall

`nix-installer` needs to run as `root`, attempting to escalate now via `sudo`...
Nix uninstall plan (v0.17.0)

Planner: macos (with default settings)

Planned actions:
* Unconfigure Nix daemon related settings with launchctl
* Delete file `/Library/LaunchDaemons/systems.determinate.nix-installer.nix-hook.plist`
* Remove the Nix configuration from zsh's non-login shells
* Unconfigure the shell profiles
* Remove the Nix configuration in `/etc/nix/nix.conf`
* Unset the default Nix profile
* Remove time machine exclusions
* Remove Nix users and group
* Remove the directory tree in `/nix`
* Remove the APFS volume `Nix Store` on `disk3`

Proceed? ([Y]es/[n]o/[e]xplain): y
 INFO Revert: Remove directory `/nix/temp-install-dir`
 INFO Revert: Configure Nix daemon related settings with launchctl
 INFO Revert: Create a `launchctl` plist to put Nix into your PATH
 INFO Revert: Configuring zsh to support using Nix in non-interactive shells
 INFO Revert: Configure Nix
 INFO Revert: Configure Time Machine exclusions
 INFO Revert: Create build users (UID 301-332) and group (GID 30000)
 INFO Revert: Provision Nix
 INFO Revert: Create an encrypted APFS volume `Nix Store` for Nix on `disk3` and add it to `/etc/fstab` mounting on `/nix`
ERROR Uninstallation complete, some errors encountered
Error: 
   0: Error reverting
   0: Action `create_or_merge_nix_config` errored
      Remove file `/etc/nix/nix.conf`
   0: 

Location:
   src/cli/subcommand/uninstall.rs:192

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

Consider reporting this error using this URL: https://github.com/DeterminateSystems/nix-installer/issues/new?title=%3Cautogenerated-issue%3E&body=%23%23+Error%0A%60%60%60%0AError%3A+%0A+++0%3A+Error+reverting%0A+++0%3A+Action+%60create_or_merge_nix_config%60+errored%0A++++++Remove+file+%60%2Fetc%2Fnix%2Fnix.conf%60%0A%0A%60%60%60%0A%0A%23%23+Metadata%0A%7Ckey%7Cvalue%7C%0A%7C--%7C--%7C%0A%7C**version**%7C0.17.0%7C%0A%7C**os**%7Cmacos%7C%0A%7C**arch**%7Caarch64%7C%0A
robertwendt@Roberts-MacBook-Air darwin % 
r33drichards commented 7 months ago
rm: /etc/nix/nix.conf: No such file or directory
robertwendt@Roberts-MacBook-Air darwin % sudo /etc/nix/nix.conf
sudo: /etc/nix/nix.conf: command not found
robertwendt@Roberts-MacBook-Air darwin % sudo rm /etc/nix/nix.conf
rm: /etc/nix/nix.conf: No such file or directory
robertwendt@Roberts-MacBook-Air darwin %