Not quite. My assignment to nixPath overrides the environment variables. To affect the registry, I use something like
registry = {
nixpkgs = {
from.type = "indirect";
from.id = "nixpkgs";
to.type = "git";
to.url = "file:///nix/nixpkgs";
};
nixos-hardware = {
from.type = "indirect";
from.id = "nixos-hardware";
to.type = "git";
to.url = "file:///nix/flake-cache/nixos-hardware.git";
};
};
This adds registry entries such as system flake:nixpkgs git+file:///nix/nixpkgs which overrides the global entries that always are present. Someday I will figure out how to eliminate the global entries, but for now I work around it, which requires that I specify inputs.nixpkgs.url in the flake.
I think also there are circumstances where some packages insist on other versions of nixpkgs, and how they do that may involve the registry. I haven’t encountered this enough to delve into it yet.
I went down this path almost entirely because I found pulling the nixpkgs tar file annoyingly slow. Doing a git remote update on my local nixpkgs took much less time. I use this only for my primary machine, which wants nixos-unstable. My various others just use the global registry entry for nixpkgs despite the slow tar download.