Use local bare git repo as flake input

I’m using the yadm dotfile manager, and I’d like to include it in my flake inputs for my config. It stores the files being managed in a bare git repo in ~/.local/share/yadm/repo.git, with the config directory at ~/.config/yadm and the working directory (-C) being the user’s home directory.

However, git+file:///root?dir=.config/yadm and git+file:///root/.local/share/yadm/repo.git?dir=.config/yadm cannot seem to find the flake at .config/yadm/flake.nix, despite it being added to the yadm repo and the changes being comitted.

What url do I have to use to use a bare repo with a flake.nix not in the root of the repository, if this setup is even possible?

Did you add the file to git? Also since the repo is in /root, are you running all these commands as root?

Well actually it doesn’t even make sense to use git+file if there’s no git repo, just use path instead.

This is also a wild setup btw, I suggest not doing this.

Interesting… I was under the impression all flake inputs need to be git repositories… I guess I forgot that tarballs could be used, so it makes that regular paths work as well. Using /root/.config/yadm worked. I’ll look into a simpler setup. Thanks!