Available attributes in local vs github flake are not the same?

I have a few non-standard flake outputs defined here: https://github.com/gvolpe/nix-config/blob/6048a641b830ed4858cdc76ffc86ee75edac3961/flake.nix#L89, which I want to use from a private flake. This works when referencing this flake locally as follows:

inputs.nix-config = {
  #url = github:gvolpe/nix-config;
  url = git+file:///home/gvolpe/workspace/nix-config;
};

But it fails to find those attributes when I point to the Github repo. Is this a known limitation? If so, where can I read more about it?

error: attribute 'mkHomeConfigurations' missing

A few things to consider:

  • I want to use these “builder” methods from a private flake.
  • I want to reuse the pkgs instance from the nix-config repo.

Here’s how I currently define my private flake’s outputs:

{
  outputs = { nix-config, ... }:
    let
      private-overlay = f: p: {};       
      pkgs = nix-config.pkgs.extend private-overlay;
    in
    {
      homeConfigurations = nix-config.mkHomeConfigurations pkgs;
      nixosConfigurations = nix-config.mkNixosConfigurations pkgs;
    };
}

I wonder if this is a case of the built-in eval cache having seen an older revision of the GitHub repo that was missing something freshly introduced that you wanted to immediately use. This wouldn’t apply for a file URL and would go away on its own after the TTL expired. There’s ways to force it to refetch using a CLI flag that I can’t type from memory.

It could be a caching issue, I’m not entirely sure what’s going on.

There’s ways to force it to refetch using a CLI flag that I can’t type from memory.

If you’re referring to --refresh, I’m using that every time while I work on this.

Alright, I managed to fix the issue. It looked indeed like some caching bad luck. I started paying closer attention to the revisions being set on my flake.lock file, and it was not always being updated even when using --refresh, so I guess that was it.

Being more explicit by running nix flake lock --update-inputs nix-config before building anything did the trick, so lesson learned for me today, hope this is useful to anyone experiencing the same issue.