-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
Description
Describe the bug
I'm trying to add a submodule to my NixOS flake repository to segregate secrects, but attempting to nix flake update or nixos-rebuild build results in an unexpected error:
$ sudo nixos-rebuild build
building the system configuration...
warning: could not read HEAD ref from repo at '/home/paul/src/nix-config', using 'master'
error:
… while fetching the input 'git+file:///home/paul/src/nix-config?rev=de26939a1ff68c8e38542163e0c9d17555e17f4f&submodules=1'
error: file:// URL 'file://moserv.lan.home.arpa:/storage/src/nix-secrets.git' has unexpected authority 'moserv.lan.home.arpa'
Steps To Reproduce
- Add a submodule to your flake repository:
git submodule init && git submodule add some_server:/path/to/repo.git secrets - Update flake.nix to declare submodule use:
inputs.self.submodules = true; - Attempt to build
sudo nixos-rebuild build - Observe "has unexpected authority error"
Expected behavior
flake builds successfully
Metadata
$ nix-env --version
nix-env (Nix) 2.31.2+1
Additional context
The error is similar to #7545 #14244, but I think this is likely a different edge case.
The error didn't occur immediately. It was only once the changes to my NixOS configuration started stabilizing that the failure started happening every time. Also, it appears to work better when the username is specified in the submodule url (user@host:/path/to/reo.git), however, that prevents other users from being able to work on the repository.
Checklist
- checked latest Nix manual (source)
- checked open bug issues and pull requests for possible duplicates
Add 👍 to issues you find important.