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

[install script] Could not find service "org.nixos.nix-daemon" in domain for system #407

Open
jkarni opened this issue Nov 14, 2023 · 8 comments
Assignees

Comments

@jkarni
Copy link
Contributor

jkarni commented Nov 14, 2023

I tried installing garn on an older MacOS machine, which already had an old version of nix installed. I got the following error:

sh <(curl --proto '=https' --tlsv1.2 -sSf https://garn.io/install.sh) 

NIX INSTALLATION
================
Hooray, nix is already installed:
nix (Nix) 2.8.0

BINARY CACHE CONFIGURATION
==========================
For 'garn' to work well, nix needs to use the garnix.io binary
cache. But the cache configuration cannot be found. This
installer will modify /etc/nix/nix.conf to add the garnix.io binary cache.

Should I add the garnix.io binary cache to /etc/nix/nix.conf now (requires sudo)? [y/n] y
trying to restart the nix-daemon...
Could not find service "org.nixos.nix-daemon" in domain for system
Failed to configure the garnix cache, cancelling installation.

This issue seems relevant.

@soenkehahn
Copy link
Contributor

Our install script did not call the determinate systems installer, since it detected that nix was installed. I wonder if that one would or could've "repaired" this somehow. Could you try running that installer manually? I think it also has a repair subcommand. (This is just speculation, maybe that installer will do nothing to solve this problem.)

@jkarni
Copy link
Contributor Author

jkarni commented Nov 14, 2023

They seem to also have this issue, though the solution there does not work for me.

@jkarni
Copy link
Contributor Author

jkarni commented Nov 14, 2023

Oh, it's just because this was a single-user install. Maybe this is an occasion to fix this?

@soenkehahn
Copy link
Contributor

Maybe this is an occasion to fix this?

That comment is not a TODO to fix, it's just trying to say that we don't abort on errors, since these commands fail in single-user installations, but in that case we just don't have to restart the nix-daemon and are already fine. What do you mean by fixing it? Don't print out the error message? It's a bit scary, since it may be a different error message that would be useful for debugging. Oh, or are you saying to detect whether it's a single-user install, like we discussed before here?

@jkarni
Copy link
Contributor Author

jkarni commented Nov 20, 2023

nix-info reports that this is not a multi-user installation. It uses nix-darwin and home-manager.

@jkarni
Copy link
Contributor Author

jkarni commented Dec 4, 2023

It occurred to me, following discussion on the garnix Discord, that we could just put the substituter in the flake.nix of garn, and then remove the installation step that tries to set the substituter globally. That should fix this, and also #402.

It doesn't work if the user isn't in trusted-users, unfortunately.

@jkarni
Copy link
Contributor Author

jkarni commented Dec 4, 2023

I guess we could have a multi-pronged approach: we try setting it globally, but don't fail if we can't (just issue a warning), and instead hope the flake-specific setting does the trick.

@soenkehahn
Copy link
Contributor

I think by default users are untrusted. So in a default nix installation this wouldn't work. Also, I think putting the cache into the flake file will mean that nix will ask the user whether these settings should be used. And if the user agrees, nix will also print out a message that these caches are being used every time nix runs. (I think that's how it works, haven't researched this more. But I think we need to look into this before considering this approach.)

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

2 participants