Dealing with depublicized (indirect) flake inputs

Hey folks,

I’m trying to integrate horizon-haskell into my project and am now encountering an annoying interaction.

The error

nix flake archive fails if any inputs cannot be fetched. Specifically:

> nix flake archive 'git+https://gitlab.horizon-haskell.net/package-sets/horizon-devtools?ref=lts/ghc-9.8.x'
fatal: unable to access 'https://gitlab.nixica.dev/nix/lint-utils/': Could not resolve host: gitlab.nixica.dev
error:
       … while fetching the input 'git+https://gitlab.nixica.dev/nix/lint-utils?ref=refs/heads/master&rev=226003d10c2d192b088f7c3c9ee7ca549c421a9c'

       error: Cannot find Git revision '226003d10c2d192b088f7c3c9ee7ca549c421a9c' in ref 'refs/heads/master' of repository 'https://gitlab.nixica.dev/nix/lint-utils'! Please make sure that the rev exists on the ref you've specified or add allRefs = true; to fetchGit.

gitlab.nixica.dev is not available under that name anymore.

Impact

I assume this issue has not been addressed yet because it doesn’t impact commands like nix develop, which seems to pull inputs lazily.
My setup uses nix-direnv, which calls nix flake archive and thus it can’t load the devshell.

Possible approaches and they don’t work very well

The obvious one would be to fix it, which is what happened on the current branch.It’s annoying though, because lint-utils is pulled in a bunch of times in a number of layers, so I’d have to fork 6+ repositories.

Overriding the indirect inputs doesn’t seem to work (or I couldn’t find out how):

  inputs = {
    horizon-devtools = {
      url = "git+https://gitlab.horizon-haskell.net/package-sets/horizon-devtools?ref=lts/ghc-9.8.x";
      inputs = {
        lint-utils.follows = "";
        horizon-core.inputs.lint-utils.follows = "";
      };
    };
  };

> nix flake update
error:
       … while updating the lock file of flake 'git+file:///my-project'

       … while updating the flake input 'horizon-devtools'

       … while updating the flake input 'horizon-devtools/horizon-core'

       error: cannot find flake 'flake:horizon-core' in the flake registries

I also looked into nix flake update options, but --override-flake seems to only be for the registry and --override-input implies --no-write-lock-file and also doesn’t seem super promising to me.

nix flake archive doesn’t seem to have an option to exclude some things, and forking nix-direnv to remove the call altogether also didn’t feel right.

Lastly, I considered opening an issue with nix-direnv, but between that project, the repo layout, and nix itself, I can’t tell which part of this puzzle should address this.


I’d appreciate any ideas to solve this immediate problem. Or assurance that it just needs to be fixed I guess. But I’m also thinking of the implications here: would the de-publication of a flake cause all downstream flakes to be unusable with direnv?

(I’m imagining the flake-utils repo disappearing one day…)

Please let me know what I’m missing here.