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

Add required nix configuration to flake nixConfig attribute #31

Closed
wants to merge 1 commit into from

Conversation

mitchmindtree
Copy link
Contributor

An attempt at enabling the fuellabs nix cache via the flake's nixConfig attribute. The idea is to hopefully remove the need for adding cache info to the user's global config and ease usage slightly.

From nix help flake:

nixConfig: a set of nix.conf options to be set when evaluating any
part of a flake. In the interests of security, only a small set of
whitelisted options (currently bash-prompt, bash-prompt-prefix,
bash-prompt-suffix, and flake-registry) are allowed to be set without
confirmation so long as accept-flake-config is not set in the global
configuration.

Currently this doesn't seem to be working - I'm running into the same issue described here NixOS/nix#6672. Either the user has to be part of the "trusted-users" set (i.e. is allowed to specify new substituters) or the fuellabs cache already has to be part of the global trusted-substituters list, otherwise the fuellabs cache is ignored.

The nixConfig also allows you to specify the required "nix-command" and "flakes" experimental-features. However, you already need to have these features to even start using the flake, so I've omitted them from the config as the user should always already have them.

An attempt at enabling the fuellabs nix cache via the flake's
`nixConfig` attribute. The idea is to hopefully remove the need for
adding cache info to the user's global config and ease usage slightly.

From `nix help flake`:

> nixConfig: a set of nix.conf options to be set when evaluating any
> part of a flake. In the interests of security, only a small set of
> whitelisted options (currently bash-prompt, bash-prompt-prefix,
> bash-prompt-suffix, and flake-registry) are allowed to be set without
> confirmation so long as accept-flake-config is not set in the global
> configuration.

Currently this doesn't seem to be working - I'm running into the same
issue described here NixOS/nix#6672. Either
the user has to be part of the "trusted-users" set (i.e. is allowed to
specify new substituters) or the fuellabs cache already has to be part
of the global `trusted-substituters` list, otherwise the fuellabs cache
is ignored.
@mitchmindtree mitchmindtree added the enhancement New feature or request label Oct 6, 2022
@mitchmindtree mitchmindtree self-assigned this Oct 6, 2022
@mitchmindtree
Copy link
Contributor Author

I raised the issues around exposing a nice UX over a custom Nix cache in this forum post:

https://discourse.nixos.org/t/ux-problems-with-flakes-and-custom-caches-substituters/23691?u=mindtree

It appears there is no immediate nice solution, but that in the long run the new CA (content-addressed) derivations feature should remove the need for trusting substituters at all.

@mitchmindtree
Copy link
Contributor Author

Closing in favour of the new installation approach in the book https://github.com/FuelLabs/fuel.nix/blob/baf2162a5b28fede20d3cc03e68eca006265c413/book/src/quick-start.md.

@mitchmindtree mitchmindtree deleted the mitchmindtree/flake-nix-config branch June 2, 2023 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant