Skip to content
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

Failed to install: /etc/nix/nix.conf: No such file or directory #7992

Open
1 of 3 tasks
magfoto opened this issue Mar 7, 2023 · 3 comments
Open
1 of 3 tasks

Failed to install: /etc/nix/nix.conf: No such file or directory #7992

magfoto opened this issue Mar 7, 2023 · 3 comments

Comments

@magfoto
Copy link

magfoto commented Mar 7, 2023

Platform

  • Linux:
  • macOS
  • WSL

Additional information

Output

Output

---- sudo execution ------------------------------------------------------------
I am executing:

    $ sudo HOME=/var/root NIX_SSL_CERT_FILE=/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt /nix/store/zrzr8zpi51sxs64d5kir0ny02sxx1kyr-nix-2.14.1/bin/nix-channel --update nixpkgs

to update the default channel in the default profile

unpacking channels...

---- sudo execution ------------------------------------------------------------
I am executing:

    $ sudo install -m 0664 /var/folders/8b/_03dmbk92nq24j117ll9dkgh0000gn/T/tmp.N8uBAYq8/nix.conf /etc/nix/nix.conf

to place the default nix daemon configuration (part 2)

install: /etc/nix/nix.conf: No such file or directory

Priorities

Add 👍 to issues you find important.

@abathur
Copy link
Member

abathur commented Mar 9, 2023

I think this implies that /etc/nix wasn't successfully created in an earlier step for some reason.

This is why it's helpful to have the full installer output, even if including it all feels absurd. If you still have it all, it'd be good to see it. If you still have part of it, can you look into what's around to place the default nix daemon configuration (part 1) in the output?

The error you encountered appears at:

_sudo "to place the default nix daemon configuration (part 2)" \
install -m 0664 "$SCRATCH/nix.conf" /etc/nix/nix.conf

The /etc/nix/ folder should've been created at:

_sudo "to place the default nix daemon configuration (part 1)" \
install -dv -m 0555 /etc/nix

@magfoto
Copy link
Author

magfoto commented Mar 9, 2023 via email

@abathur
Copy link
Member

abathur commented Mar 9, 2023

Ah.

This may be going wrong downstream from:

~~> Fixing any leftover Nix volume state
Before I try to install, I'll check for any existing Nix volume config
and ask for your permission to remove it (so that the installer can
start fresh). I'll also ask for permission to fix any issues I spot.

During install, I add 'nix' to /etc/synthetic.conf, which instructs
macOS to create an empty root directory for mounting the Nix volume.

Nix isn't the only thing in /var/folders/8b/_03dmbk92nq24j117ll9dkgh0000gn/T/tmp.N8uBAYq8/synthetic.conf.edit,
but I think I know how to edit it out.
Here's the diff:
diff: unrecognized option `--unchanged-group-format=\033[2m%=\033[0m'
usage: diff [-aBbdilpTtw] [-c | -e | -f | -n | -q | -u] [--ignore-case]
            [--no-ignore-case] [--normal] [--strip-trailing-cr] [--tabsize]
            [-I pattern] [-F pattern] [-L label] file1 file2
       diff [-aBbdilpTtw] [-I pattern] [-L label] [--ignore-case]
            [--no-ignore-case] [--normal] [--strip-trailing-cr] [--tabsize]
            [-F pattern] -C number file1 file2
       diff [-aBbdiltw] [-I pattern] [--ignore-case] [--no-ignore-case]
            [--normal] [--strip-trailing-cr] [--tabsize] -D string file1 file2
       diff [-aBbdilpTtw] [-I pattern] [-L label] [--ignore-case]
            [--no-ignore-case] [--normal] [--tabsize] [--strip-trailing-cr]
            [-F pattern] -U number file1 file2
       diff [-aBbdilNPprsTtw] [-c | -e | -f | -n | -q | -u] [--ignore-case]
            [--no-ignore-case] [--normal] [--tabsize] [-I pattern] [-L label]
            [-F pattern] [-S name] [-X file] [-x pattern] dir1 dir2
       diff [-aBbditwW] [--expand-tabs] [--ignore-all-blanks]
            [--ignore-blank-lines] [--ignore-case] [--minimal]
            [--no-ignore-file-name-case] [--strip-trailing-cr]
            [--suppress-common-lines] [--tabsize] [--text] [--width]
            -y | --side-by-side file1 file2
       diff [--help] [--version]
Does the change above look right?
[y/n] y

This is a known issue that started cropping up in Ventura when macOS changed from GNU to their own home-grown diff implementation. There is a candidate fix PR, but it hasn't been merged/released yet.

If you have homebrew installed, you should be able to work around the issue for now by running brew install diffutils.

You'll have to follow the uninstall instructions before trying to reinstall Nix: https://nixos.org/manual/nix/stable/installation/installing-binary.html#macos

Here's the initial report and fix PR:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants