-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Installer fails to (re)install nix on macOS Ventura with nix-darwin #528
Comments
I "tricked" the installer by manually doing this:
After the installer failed, I did not revert it changes and tried again |
After this, I noticed that |
After some thinking about this over the weekend, I'm wondering if one of the nix daemons is responsible for mounting the My plan is to check if there are some logs on the nix daemons that would report an error. |
Uhm, after reading #529, I went ahead and set explicitly the latest version of the installer, and that seemed to work. I'm still getting a very rare error when trying to build a
It seems there is some state hanging on the flake configuration? |
@roman I'm glad to know 0.9.1 was offering you a better experience. I'm sorry about the issues you were having with 0.8.0, they are indeed quite funky. In this case does |
No, and nix flakes are not downloading it. I would like to know if it has something to do with the lazy input setup they have in place. Very weird behavior indeed |
Ok, I was never able to get the dependency worked out. I had to change the
|
Tried this solution step, and it worked as expected. There was a dangling file from the previous installation:
I wonder if |
Hmmm that's interesting... Did you pass an |
No, I didn't use that option during the execution of I have a flake + nix-darwin + home-manager setup; I know nix-darwin does some overrides to the |
Okay, I'll need to do some testing then. THanks for reporting! |
I'm not sure if I am approaching the same area. I had an old
But whenever I try to do anything I get this SSL CA Cert error:
My
My
I feel kinda clueless and I'm not sure it's related to my previous old Thank you! |
After some more reading it appears the issue is the cert:
If I understand this correctly it means that my cert is symlinked to the old My idea is that the cause of this is me "nuking" my old Nix installation without properly running the I see people mention that they "fix" the symbolic link. My question being: How do I fix it? :D @roman Thank you once again! |
Sorry for being a slow person but I removed the |
So neither this crate or the official install scripts provision If you try running
That's likely what's causing the issue. I think doing |
ephemeraladmin@mac-epic-turducken ~ % curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
info: downloading installer https://install.determinate.systems/nix/tag/v0.10.0/nix-installer-aarch64-darwin
`nix-installer` needs to run as `root`, attempting to escalate now via `sudo`...
Nix install plan (v0.10.0)
Planner: macos (with default settings)
Planned actions:
* Create an APFS volume `Nix Store` for Nix on `disk2` and add it to `/etc/fstab` mounting on `/nix`
* Fetch `https://releases.nixos.org/nix/nix-2.15.0/nix-2.15.0-aarch64-darwin.tar.xz` to `/nix/temp-install-dir`
* Create a directory tree in `/nix`
* Move the downloaded Nix into `/nix`
* Create build users (UID 300-332) and group (GID 30000)
* Configure Time Machine exclusions
* Setup the default Nix profile
* Place the Nix configuration in `/etc/nix/nix.conf`
* Configure the shell profiles
* Configure Nix daemon related settings with launchctl
* Remove directory `/nix/temp-install-dir`
Proceed? ([Y]es/[n]o/[e]xplain): y
INFO Step: Create an APFS volume `Nix Store` for Nix on `disk2` and add it to `/etc/fstab` mounting on `/nix`
INFO Step: Provision Nix
INFO Step: Create build users (UID 300-332) and group (GID 30000)
INFO Step: Configure Time Machine exclusions
INFO Step: Configure Nix
INFO Step: Configure Nix daemon related settings with launchctl
INFO Step: Remove directory `/nix/temp-install-dir`
Nix was installed successfully!
To get started using Nix, open a new shell or run `. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh`
ephemeraladmin@mac-epic-turducken ~ % . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh Then, following this I wrote this to {
description = "John's darwin system";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-23.05-darwin";
darwin.url = "github:lnl7/nix-darwin/master";
darwin.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs@{ self, darwin, nixpkgs }: {
darwinConfigurations."mac-epic-turducken" = darwin.lib.darwinSystem {
modules = [(
{ pkgs, ... }:
{
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment.systemPackages =
[ pkgs.vim
];
# Auto upgrade nix package and the daemon service.
services.nix-daemon.enable = true;
nix.package = pkgs.nix;
nixpkgs.hostPlatform = "aarch64-darwin";
}
)];
};
};
} After, ephemeraladmin@mac-epic-turducken boop % nix build .#darwinConfigurations.mac-epic-turducken.system
ephemeraladmin@mac-epic-turducken boop % sudo ./result/sw/bin/darwin-rebuild switch --flake ~/boop
warning: $HOME ('/Users/ephemeraladmin') is not owned by you, falling back to the one defined in the 'passwd' file ('/var/root')
building the system configuration...
warning: $HOME ('/Users/ephemeraladmin') is not owned by you, falling back to the one defined in the 'passwd' file ('/var/root')
warning: $HOME ('/Users/ephemeraladmin') is not owned by you, falling back to the one defined in the 'passwd' file ('/var/root')
error: Directory /run does not exist, aborting activation
Create a symlink to /var/run with:
$ printf 'run\tprivate/var/run\n' | sudo tee -a /etc/synthetic.conf
$ /System/Library/Filesystems/apfs.fs/Contents/Resources/apfs.util -B # For Catalina
$ /System/Library/Filesystems/apfs.fs/Contents/Resources/apfs.util -t # For Big Sur and later
The current contents of /etc/synthetic.conf is:
nix
ephemeraladmin@mac-epic-turducken boop % printf 'run\tprivate/var/run\n' | sudo tee -a /etc/synthetic.conf
ephemeraladmin@mac-epic-turducken boop % sudo /System/Library/Filesystems/apfs.fs/Contents/Resources/apfs.util -t
ephemeraladmin@mac-epic-turducken boop % sudo ./result/sw/bin/darwin-rebuild switch --flake ~/boop
warning: $HOME ('/Users/ephemeraladmin') is not owned by you, falling back to the one defined in the 'passwd' file ('/var/root')
building the system configuration...
warning: $HOME ('/Users/ephemeraladmin') is not owned by you, falling back to the one defined in the 'passwd' file ('/var/root')
warning: $HOME ('/Users/ephemeraladmin') is not owned by you, falling back to the one defined in the 'passwd' file ('/var/root')
user defaults...
setting up user launchd services...
setting up /Applications/Nix Apps...
setting up pam...
applying patches...
setting up /etc...
error: not linking environment.etc."bashrc" because /etc/bashrc already exists, skipping...
existing file has unknown content 08ffbf991a9e25839d38b80a0d3bce3b5a6c84b9be53a4b68949df4e7e487bb7, move and activate again to apply
error: not linking environment.etc."nix/nix.conf" because /etc/nix/nix.conf already exists, skipping...
existing file has unknown content 9b5b5aedd302e950e450a28d6d42cc087bfd1c40951c4617096b9b12b2007c5f, move and activate again to apply
system defaults...
setting up launchd services...
creating service org.nixos.activate-system
reloading service org.nixos.nix-daemon
reloading nix-daemon...
waiting for nix-daemon
waiting for nix-daemon
configuring networking...
ephemeraladmin@mac-epic-turducken boop % At this point, I can review
All good so far. Now uninstalling and reinstalling: ephemeraladmin@mac-epic-turducken boop % /nix/nix-installer uninstall
`nix-installer` needs to run as `root`, attempting to escalate now via `sudo`...
Nix uninstall plan (v0.10.0)
Planner: macos (with default settings)
Planned actions:
* Unconfigure Nix daemon related settings with launchctl
* 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 `disk2`
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: Configure Nix
INFO Revert: Configure Time Machine exclusions
INFO Revert: Create build users (UID 300-332) and group (GID 30000)
INFO Revert: Provision Nix
INFO Revert: Create an APFS volume `Nix Store` for Nix on `disk2` and add it to `/etc/fstab` mounting on `/nix`
Nix was uninstalled successfully!
ephemeraladmin@mac-epic-turducken boop % curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
info: downloading installer https://install.determinate.systems/nix/tag/v0.10.0/nix-installer-aarch64-darwin
`nix-installer` needs to run as `root`, attempting to escalate now via `sudo`...
Nix install plan (v0.10.0)
Planner: macos (with default settings)
Planned actions:
* Create an APFS volume `Nix Store` for Nix on `disk2` and add it to `/etc/fstab` mounting on `/nix`
* Fetch `https://releases.nixos.org/nix/nix-2.15.0/nix-2.15.0-aarch64-darwin.tar.xz` to `/nix/temp-install-dir`
* Create a directory tree in `/nix`
* Move the downloaded Nix into `/nix`
* Create build users (UID 300-332) and group (GID 30000)
* Configure Time Machine exclusions
* Setup the default Nix profile
* Place the Nix configuration in `/etc/nix/nix.conf`
* Configure the shell profiles
* Configure Nix daemon related settings with launchctl
* Remove directory `/nix/temp-install-dir`
Proceed? ([Y]es/[n]o/[e]xplain): y
INFO Step: Create an APFS volume `Nix Store` for Nix on `disk2` and add it to `/etc/fstab` mounting on `/nix`
INFO Step: Provision Nix
INFO Step: Create build users (UID 300-332) and group (GID 30000)
INFO Step: Configure Time Machine exclusions
INFO Step: Configure Nix
INFO Step: Configure Nix daemon related settings with launchctl
INFO Step: Remove directory `/nix/temp-install-dir`
Nix was installed successfully!
To get started using Nix, open a new shell or run `. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh`
ephemeraladmin@mac-epic-turducken boop % nix run nixpkgs#hello
warning: cannot read flake registry '/etc/nix/registry.json': error: opening file '/etc/nix/registry.json': No such file or directory
error: unable to download 'https://cache.nixos.org/d26w2dip6kcjpw6dfcrjmpkprrabjz60.narinfo': Problem with the SSL CA cert (path? access rights?) (77) Which seems to reproduce! However ephemeraladmin@mac-epic-turducken boop % launchctl unsetenv NIX_SSL_CERT_FILE
ephemeraladmin@mac-epic-turducken boop % unset NIX_SSL_CERT_FILE
ephemeraladmin@mac-epic-turducken boop % sudo launchctl kickstart -k system/org.nixos.nix-daemon
ephemeraladmin@mac-epic-turducken boop % nix run nixpkgs#hello
warning: cannot read flake registry '/etc/nix/registry.json': error: opening file '/etc/nix/registry.json': No such file or directory
error: unable to download 'https://cache.nixos.org/d26w2dip6kcjpw6dfcrjmpkprrabjz60.narinfo': Problem with the SSL CA cert (path? access rights?) (77) Hmm... It seems the uninstall requires Nix, so this does present a bit of a pickle. |
Running the uninstall before removing nix seems to work fine: ephemeraladmin@mac-epic-turducken boop % ./result/bin/darwin-uninstaller
Uninstalling nix-darwin, this will:
- remove ~/Applications link.
- 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
removing service org.nixos.nix-daemon
configuring networking...
rm: cannot remove '/Library/LaunchDaemons/org.nixos.nix-daemon.plist': No such file or directory
NOTE: The /nix/var/nix/profiles/system* profiles still exist and won't be garbage collected.
Done!
ephemeraladmin@mac-epic-turducken boop % nix build nixpkgs#hello
ephemeraladmin@mac-epic-turducken boop % nix build nixpkgs#hello --tarball-ttl 0
ephemeraladmin@mac-epic-turducken boop % /nix/nix-installer uninstall
`nix-installer` needs to run as `root`, attempting to escalate now via `sudo`...
Nix uninstall plan (v0.10.0)
Planner: macos (with default settings)
Planned actions:
* Unconfigure Nix daemon related settings with launchctl
* 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 `disk2`
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: Configure Nix
INFO Revert: Configure Time Machine exclusions
INFO Revert: Create build users (UID 300-332) and group (GID 30000)
INFO Revert: Provision Nix
INFO Revert: Create an APFS volume `Nix Store` for Nix on `disk2` and add it to `/etc/fstab` mounting on `/nix`
Nix was uninstalled successfully!
ephemeraladmin@mac-epic-turducken boop % curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
info: downloading installer https://install.determinate.systems/nix/tag/v0.10.0/nix-installer-aarch64-darwin
`nix-installer` needs to run as `root`, attempting to escalate now via `sudo`...
Nix install plan (v0.10.0)
Planner: macos (with default settings)
Planned actions:
* Create an APFS volume `Nix Store` for Nix on `disk2` and add it to `/etc/fstab` mounting on `/nix`
* Fetch `https://releases.nixos.org/nix/nix-2.15.0/nix-2.15.0-aarch64-darwin.tar.xz` to `/nix/temp-install-dir`
* Create a directory tree in `/nix`
* Move the downloaded Nix into `/nix`
* Create build users (UID 300-332) and group (GID 30000)
* Configure Time Machine exclusions
* Setup the default Nix profile
* Place the Nix configuration in `/etc/nix/nix.conf`
* Configure the shell profiles
* Configure Nix daemon related settings with launchctl
* Remove directory `/nix/temp-install-dir`
Proceed? ([Y]es/[n]o/[e]xplain): y
INFO Step: Create an APFS volume `Nix Store` for Nix on `disk2` and add it to `/etc/fstab` mounting on `/nix`
INFO Step: Provision Nix
INFO Step: Create build users (UID 300-332) and group (GID 30000)
INFO Step: Configure Time Machine exclusions
INFO Step: Configure Nix
INFO Step: Configure Nix daemon related settings with launchctl
INFO Step: Remove directory `/nix/temp-install-dir`
Nix was installed successfully!
To get started using Nix, open a new shell or run `. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh`
ephemeraladmin@mac-epic-turducken boop % . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
ephemeraladmin@mac-epic-turducken boop % nix build nixpkgs#hello --tarball-ttl 0
ephemeraladmin@mac-epic-turducken boop % |
It seems like However I would like to know how to fix the situation if the user doesn't do this... |
I see. Yes, having some kind of error/warning throwing me out of the installer when running on a previous installation, including Well, MY problems are over now! I've managed to salvage my installation properly by cleaning up all the stale symlinks in The culprit that gave me the biggest pain: After that I followed the official instruction for uninstalling Nix here: https://nixos.org/manual/nix/stable/installation/uninstall.html#macos. During this phase I had some issues with I probably rebooted my computer after this just because I can and it feels good. After this I installed Nix using the
With flakes enabled I could now "bootstrap" my |
That is what we are going to do with #561! Thanks for documenting your further exploration! I'll see if we can teach the installer how to workaround this. Glad you got it working! |
This is awesome. Thanks for digging even further. I was able to move forward by manually removing the cert files. |
Thanks for this! Yes can confirm all the same issues arose for me when I got rid of an old installation of nix and reinstalled without running the nix-darwin uninstall first. When I started to suspect issue was related to nix-darwin residual state I discovered the nix-darwin uninstall script was in... /nix/ which was gone. Removing ssl symlink fixed issue. I'd also note the motivation for removing nix (very old community installation on 2015 iMac) was I had an issue trying to add the determinate systems version of nix to my existing nix-darwin flake. When I tried any query to the nix store or to fetch from caches after rebuilding my darwin-config with the determinate input added the commands were just hanging i thought might be related to sqlite locks or similar. I couldn't debug which prompted me to want to do a clean reinstallation. Potentially though the issue was related to the ssl certs or the daemon. Anyway manually cleaning up ssl certs and using detsys installer worked. Going to add nix-darwin back now with proviso that if a future full system reinstallation done make sure to clean up nix-darwin first. |
I had
nix
previously installed and had to remove it manually. Now the installation process fails with the error bellow.Error
Metadata
The text was updated successfully, but these errors were encountered: