`cachix use` with declaratively managed nix.conf

I manage my nix.conf in my home-manager configuration. This means that when the devenv tutorial tells me to do cachix use devenv, I get

cachix: /home/james/.config/nix/nix.conf: withFile: permission denied (Permission denied)

From memory, cachix use adds a url to the substituters list.
My first instinct is to assume that the rule is cachix use foo just means “add foo.cachix.org to substituters in nix.conf”.
Is this correct? If so all I need to do is add that url to my home-manager config. But it occurred to me that this might not be sufficient, it might add to trusted public keys and do other things as well.


I did cachix use devenv -O ~/tmp/cachix-use-devenv and it created a directory containing a nix.conf with the following contents

substituters = https://cache.nixos.org https://devenv.cachix.org
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=

I’ll be able to copy those settings into my config.

Related issue: