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

Custom nix settings don't work with determinate nix on MacOS #1298

Open
onnimonni opened this issue Jan 26, 2025 · 2 comments
Open

Custom nix settings don't work with determinate nix on MacOS #1298

onnimonni opened this issue Jan 26, 2025 · 2 comments

Comments

@onnimonni
Copy link

Hey,

Custom nix settings should be written to /etc/nix/nix.custom.conf when using nix from the Determinate Nix pkg: https://docs.determinate.systems/getting-started/

When I try to do that like this:

# Custom nix rules to use determinate nix installer with nix-darwin
{ pkgs, ... }:
{
  # Needed since Determinate Nix manages the main config file for system.
  environment.etc."nix/nix.custom.conf".text = pkgs.lib.mkForce ''
    # Add nix settings to seperate conf file
    # since we use Determinate Nix on our systems.
    trusted-users = onnimonni
    extra-substituters = https://devenv.cachix.org
    extra-trusted-public-keys = devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=
  '';
}

And If I use it darwin-rebuild works on the first run but then on the second run it fails like this:

$ darwin-rebuild switch --flake .
building the system configuration...
warning: Git tree '/Users/onnimonni/.dotfiles' is dirty
error: custom settings in `/etc/nix/nix.custom.conf`, aborting activation
You will need to migrate these to nix-darwin `nix.*` settings if you
wish to keep them. Check the manual for the appropriate settings and
add them to your system configuration, then run:

  $ sudo mv /etc/nix/nix.custom.conf{,.before-nix-darwin}

and activate your system again.

Do we really need to have the activation script for the /etc/nix/nix.custom.conf?

Could we somehow detect that the system is using nix from the Determinate nix and then write the nixConf into this custom path instead so that it will be persisted?

Versions

$ determinate-nixd --version
determinate-nixd 0.3.0
$ nix --version
nix (Nix) 2.25.3
# MacOS version
$ sw_vers -productVersion
15.2
@frankiewiczkamil
Copy link

I've started experiencing this recently as well. Seems related to this one, so I wonder if it should be fixed here or on determinate side

@emilazy
Copy link
Collaborator

emilazy commented Jan 30, 2025

I’ve replied at #1296 (comment). #1313 should be the best way forward for Determinate users.

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

No branches or pull requests

3 participants