I could for example setup our company proxy to serve these files. It will be a different url. Or download the file by our company security team and send it to me once in a while.
How can I change the url of the file so that nix profile upgrade will download this repository from a different url?
I could just point it to a git clone and git pull once in a while. Or I could git clone the repository and make the .tar.gz myself.
Can nix profile upgrade use file:// urls to download it?
Can it just use git clone for the repository? Can it use a repository already cloned locally for the url?
How can I change the url of the file so that nix profile upgrade will download this repository from a different url?
You can make use of the nix registry add command to change the URL, for a specific user you would use nix registry add nixpkgs https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz or if you want it system-wide nix registry add --registry /etc/nix/registry.json nixpkgs https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz, I used https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz as an example of a flake ref here, but you can replace it with any other kind of flake ref.
Can nix profile upgrade use file:// urls to download it?
I don’t think it understands it if you use file://, but we do have path: which you can use like this path:/local/location/to/my/nixpkgs/repo, if you use the commands from above.
Can it just use git clone for the repository?
Yes you can use git+https://github.com/NixOS/nixpkgs as the falke ref to load it over git.
Can it use a repository already cloned locally for the url?
Yes, you can use git+file:///home/my-user/some-repo/some-repo as flake ref to use a local git repo.
I would recommend using https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz as the flake ref in most cases