Skip to content

devenv is configured to automatically manage binary caches with cachix.enable = true, but cannot do so because you are not a trusted user of the Nix store. #1725

Closed
@nalzok

Description

Describe the bug
According to this comment, the warning devenv is configured to automatically manage binary caches with cachix.enable = true, but cannot do so because you are not a trusted user of the Nix store. should be suppressed in version 1.4.0 with cachix.enable = true;, but I'm still getting it.

To reproduce

We first set extra-substituters and extra-trusted-public-keys (according to the b) Add the missing binary caches to /etc/nix/nix.conf yourself: part in the warning message)

$ cat /etc/nix/nix.conf
# WARNING: this file is generated from the nix.* options in
# your nix-darwin configuration. Do not edit it!
allowed-users = *
auto-optimise-store = false
build-users-group = nixbld
builders =
cores = 0
experimental-features = nix-command flakes
extra-sandbox-paths =
extra-substituters = https://nixpkgs-python.cachix.org https://devenv.cachix.org
extra-trusted-public-keys = nixpkgs-python.cachix.org-1:hxjI7pFxTyuTHn2NkvWCrAUcNZLNS3ZAvfYNuYifcEU= devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=
max-jobs = auto
require-sigs = true
sandbox = false
sandbox-fallback = false
substituters = https://cache.nixos.org/
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
trusted-substituters =
trusted-users = root

Then, we create a new directory, run devenv init in it, and get the warning

$ devenv init
Creating devenv.nix
Creating devenv.yaml
Creating .envrc
Creating .gitignore
direnv: loading /private/tmp/test/.envrc
direnv: using devenv
• Building shell ...
warning: creating lock file '/private/tmp/test/devenv.lock'
• Using Cachix: devenv
Failed to set up binary caches:

   https://devenv.cachix.org

devenv is configured to automatically manage binary caches with `cachix.enable = true`, but cannot do so because you are not a trusted user of the Nix store.

You have several options:

a) To let devenv set up the caches for you, add yourself to the trusted-users list in /etc/nix/nix.conf:

     trusted-users = root qys

   Then restart the nix-daemon:

     $ sudo launchctl kickstart -k system/org.nixos.nix-daemon

b) Add the missing binary caches to /etc/nix/nix.conf yourself:

     extra-substituters = https://devenv.cachix.org
     extra-trusted-public-keys = devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw= nixpkgs-python.cachix.org-1:hxjI7pFxTyuTHn2NkvWCrAUcNZLNS3ZAvfYNuYifcEU=

c) Disable automatic cache management in your devenv configuration:

     {
       cachix.enable = false;
     }

Failed to get cachix caches due to evaluation error
✖ Building shell in 4.32s
Running tasks     devenv:enterShell
Succeeded         devenv:enterShell 6ms
1 Succeeded                         6.74ms

hello from devenv
git version 2.47.0
direnv: export +AR +AS +CC +CONFIG_SHELL +CXX +DEVELOPER_DIR +DEVENV_DIRENVRC_ROLLING_UPGRADE +DEVENV_DIRENVRC_VERSION +DEVENV_DOTFILE +DEVENV_PROFILE +DEVENV_ROOT +DEVENV_RUNTIME +DEVENV_STATE +DEVENV_TASKS +GREET +IN_NIX_SHELL +LD +LD_DYLD_PATH +MACOSX_DEPLOYMENT_TARGET +NIX_APPLE_SDK_VERSION +NIX_BINTOOLS +NIX_BINTOOLS_WRAPPER_TARGET_HOST_aarch64_apple_darwin +NIX_CC +NIX_CC_WRAPPER_TARGET_HOST_aarch64_apple_darwin +NIX_CFLAGS_COMPILE +NIX_DONT_SET_RPATH +NIX_DONT_SET_RPATH_FOR_BUILD +NIX_ENFORCE_NO_NATIVE +NIX_HARDENING_ENABLE +NIX_IGNORE_LD_THROUGH_GCC +NIX_LDFLAGS +NIX_NO_SELF_RPATH +NIX_PKG_CONFIG_WRAPPER_TARGET_HOST_aarch64_apple_darwin +NIX_STORE +NM +OBJCOPY +OBJDUMP +PATH_LOCALE +PKG_CONFIG +RANLIB +SDKROOT +SIZE +SOURCE_DATE_EPOCH +STRINGS +STRIP +ZERO_AR_DATE +__darwinAllowLocalNetworking +__impureHostDeps +__propagatedImpureHostDeps +__propagatedSandboxProfile +__sandboxProfile +cmakeFlags +configureFlags +hardeningDisable +mesonFlags +name +system ~PATH ~XDG_DATA_DIRS

Version

I'm not sure if I'm using flakes. How do I find out?

$ devenv version
devenv 1.4.0 (aarch64-darwin)

Activity

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

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingnixAn upstream issue with Nix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions