LnL7 / nix-darwin

nix modules for darwin
MIT License
2.8k stars 429 forks source link

My flake installation keeps crashing. #602

Open PlumpMath opened 1 year ago

PlumpMath commented 1 year ago

My flake installation keeps crashing. intel-mac Monterey was broken, so I solved it by reinstalling, My intel-mac with ventura was broken after garbage collection today.

Luckily, I got the PATH information from the terminal that remembers the PATH setting, Not erased, survived, but

https://github.com/NixOS/nix/issues/3261?fbclid=IwAR3JLGucR5Gx7UQeMngju95zjilGp6JZzkxcd4RgsV7P8_2YZoKcEwxL-ZU

in the last month? In ventura, you need to reboot for nix-build to take effect. When will it stabilize?

One of the two Macs is set up as home-manager, should I configure two test types.. I'm contemplating.

I hope the nix-darwin flake will be stabilized soon.

PlumpMath commented 1 year ago

$ sudo nix-collect-garbage -d $ sudo nix-store --gc --print-dead $ sudo nix-store --optimise

After doing that, the ssl went away. The function to set the initialization is erased. Because after restoring ssl by applying the ssl solution link above, nix build and switch are executed. However, it cannot restore the initial settings as before.

error: unable to download 'https://github.com/LnL7/nix-darwin/archive/master.tar.gz': Problem with the SSL CA cert (path? access rights?) (77)

The rest of the macs also lost ssl;; I'll have to try reinstalling recovery.

First, I changed home-manager as main, (It is unknown whether the migrate work of home-manager can also restore env-vars initialization settings. I'll leave the results in the comments again.)

second.. install as basic(not flake method) nix-darwin for addon.

PlumpMath commented 1 year ago

In the build where home-manager is the main one, initial setup problems such as environment variables are set up well without any problems. Now all that remains is to add spice(nix-darwin) on top of hm.

PlumpMath commented 1 year ago

Troubleshooting working... nix completely blown away. I'm not sure why. It looks like there is a problem with the garbage collection command above.

It's not because of nix-darwin (because the problem occurred in montery, which left only the home-manager where nix-darwin was deleted. )

Perhaps if ventura is also deleted after reboot ventura com, my garbage collector command is dangerous, and It is probably recognized as a problem with nix itself, which is the core source.

https://nixos.org/guides/nix-pills/garbage-collector.html Reading and re-arranging the documentation. (After rebooting, report the result.)

PlumpMath commented 1 year ago

error: not linking environment.etc."nix/nix.conf" because /etc/nix/nix.conf already exists, skipping... existing file has unknown content ff08c12813680da98c4240328f828647b67a65ba7aa89c022bd8072cba862cf1, move and activate again to apply

PlumpMath commented 1 year ago

I adjusted garbage collection, deleted all of nix, and reinstalled. I don't know why there was an error that was cleared by gc .

bestlem commented 1 year ago

A complete guess but if you use flakes then you don't use nix/nix.conf and so that could be gced away and so no existing link.

andrewcrook commented 1 year ago

error: unable to download 'https://github.com/LnL7/nix-darwin/archive/master.tar.gz': Problem with the SSL CA cert (path? access rights?) (77)

I have had that its caused by either the file not existing and returning 404 or the parameters are wrong for the for example github: does take the full HTTPS path but rather github:/lnl7/nix-darwin or if pinned the hash for that revision eg"github:lnl7/nix-darwin/379d42fad6bc5c28f79d5f7ff2fa5f1c90cb7bf8"

andrewcrook commented 1 year ago

SSL CA cert

Main systems are not touched they remain safe in keychain

PlumpMath commented 1 year ago

Recently, there haven't been any issues, and it doesn't crash. I'm not sure why, but for a while, I only did gc without sudo in nix-darwin.

andrewcrook commented 1 year ago

I only did gc without sudo in nix-darwin.

I am still unsure of many thinhs regarding NIX there is just so much incorrect and outdated information out there. However, regarding nix for Darwin it sets up multiple user mode by default so I thought everything is done via the daemon which has root access, therefore, you don't need to use sudo. May be someone can verify that?

I think auto garbage collection and store optimisation settings are also carried out by the daemon, if enabled.