How to store a fixed version of a github repo in the Nix Store

I’m creating a flake.nix for my Nixos system configuration. I have all my dotfiles in a github repo. To get a fully reproducible system I was thinking of storing a fixed version of the repo in the Nix Store and symlink the config files to the right places using home manager.

I have no idea how to go about this. Do I need to add my dotfiles repo as a flake? How would I know the path to the repo in the Nix Store. Some code examples would help me a lot.

Thanks. :slightly_smiling_face:

1 Like

Not a full answer since I don’t use hm, but I imagine a good first question is whether your flake.nix will live in a different git repo than your dotfiles? (some separate these, but I imagine it’s most common for these to be a single repo)

If you’re sure it will, you can use a non-flake repo as a flake input by adding a flake = false attr, something like:

inputs.dotfiles = {
    url = "github:you/dotfiles";
    flake = false;

flake = false is the correct answer for the title question. And the best answer for managing dotfiles with nix is most certainly home-manager :slight_smile:

flake = false looks like what I want. But how do I use this input as a source in home-manager? Sorry if this is trivial but I’m quite new to nix. looks like it’s accomplishing the same broad goal, so that repo might work as a reference?