DeterminateSystems / nix-installer

Install Nix and flakes with the fast and reliable Determinate Nix Installer, with over 2 million installs.
GNU Lesser General Public License v2.1
1.8k stars 48 forks source link

Nix-Darwin flake fails to install after using DS nix installer #978

Open someones-github-account opened 1 month ago

someones-github-account commented 1 month ago

I've just cleaned my mac of nix (with nix-darwin and home manager) that used the nixos installer, and re-installed nix with your Determinate Systems installer.

I'm now trying to install nix-darwin via

nix run nix-darwin -- switch --flake 'myhostname#'

to use my existing nix-darwin flake and home manager config, and getting the following error. If this is a nix error and not one related to your installer, please say and I'll delete this issue, but I'm noting here first due to the flake-oriented nature of your installer and assuming there's a bug via it, else nix-darwin.

error (ignored): error: end of string reached
error:
       … in the condition of the assert statement
         at «nix-internal»/call-flake.nix:79:13:
           78|           if node.flake or true then
           79|             assert builtins.isFunction flake.outputs;
             |             ^
           80|             result

       … while calling the 'isFunction' builtin
         at «nix-internal»/call-flake.nix:79:20:
           78|           if node.flake or true then
           79|             assert builtins.isFunction flake.outputs;
             |                    ^
           80|             result

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: path '/nix/store/22qgs3skscd9bmrxv9xv4q5d4wwm5ppx-source' does not exist

My setup is as follows:

Mac Studio, M2 Max, Sonoma 14.3.1 (23D60)

/etc/nix/nix.conf (as per your installer)

~/.config/nix-darwin/flake.nix (nix-darwin's flake. Its config is inline as per the template)

~/.config/nix-darwin/nixpkgs/home.nix (home manager's config)

arthurk commented 1 month ago

I had the same problem after I switched to the DS installer. It turns out to be an old ca-cert causing the issue. I removed it and it worked:

sudo rm /etc/ssl/certs/ca-certificates.crt

related https://github.com/NixOS/nix/issues/10821