I’m trying to use a flake registry to see if that would help us syncing our projects’ dependencies and make our cache a bit more useful and cut down on times individual developers are stuck waiting for a massive rebuild of Haskell packages.
Ideally I’d like to keep the registry file, flake-registry.json, in private repo on GitHub, but I can’t work out if there’s a way to set the nixConfig.flake-registry so it works. All I find online suggests that if I want to fetch an individual file using curl then I’ll need to add headers to the request… something that I don’t think is possible to set up using nixConfig in a flake. Or is it?
I’ve also tried using URIs with the protocol 'git+httpsbut that seems to not be supported for theflake-regsitry` (even though it works fine for inputs).
nix.registry = {
nixpkgs = {
from = {
type = "indirect";
id = "nixpkgs";
};
to = {
type = "git";
url = "https://github.com/nixos/nixpkgs.git";
};
};
nixos-hardware = {
from = {
type = "indirect";
id = "nixos-hardware";
};
to = {
type = "git";
url = "https://github.com/nixos/nixos-hardware.git";
};
};
};
nix registry list then shows those entries.
However, as far as I can tell, nixos-rebuild still pulls global flake:nixpkgs unless the root flake has a value for inputs.nixpkgs.url. I haven’t yet tried to figure out why.