npins: adding lix fails with "default" behaviour

npins add git https://git.lix.systems/lix-project/lix

adds

    "lix": {
      "type": "GitRelease",
      "repository": {
        "type": "Git",
        "url": "https://git.lix.systems/lix-project/lix"
      },
      "pre_releases": false,
      "version_upper_bound": null,
      "release_prefix": null,
      "version": "2.90.0",
      "revision": "2a4376be20d70feaa2b0e640c5041fb66ddc67ed",
      "url": null,
      "hash": "1iyylsiv1n6mf6rbi4k4fm5nv24a940cwfz92gk9fx6axh2kxjbz"
    },

but

nix-instantiate --eval npins -A lix.outPath

produces the following error:


fetching git input 'git+https://git.lix.systems/lix-project/lix'
error:
       … while calling the 'fetchGit' builtin
         at /home/olaf/dotfiles/npins/default.nix:26:43:
           25|       })
           26|     else assert repository.type == "Git"; builtins.fetchGit {
             |                                           ^
           27|       url = repository.url;

       … while fetching the input 'git+https://git.lix.systems/lix-project/lix?rev=2a4376be20d70feaa2b0e640c5041fb66ddc67ed'

       error: Cannot find Git revision '2a4376be20d70feaa2b0e640c5041fb66ddc67ed' in ref 'refs/heads/main' of repository 'https://git.lix.systems/lix-project/lix'! Please make sure that the rev exists on the ref you've specified or add allRefs = true; to fetchGit.

the problem is that nix expect main as branch but the release is on release-2.90 branch. i wonder if this is a inherent problem of buildins.fetchGit or if it can be somehow mitigated. with information we have in npins (but do not store yet).

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 17 (9 by maintainers)

Commits related to this issue

Most upvoted comments

Perhaps there is apetite in the Lix community to fix this issue once and for all? Perhaps using fetchTree would be a workaround if we require a newer Nix version / use it when available? I don’t like the idea of advocating for newer Nix as that usually causes tons of other issues and then people will think the old version is “buggy” while it is just an unfortunate combination of versions and forks 😦

Note: this situation is a bit spicy as it involves:

With Nix starting somewhen after 2.18, passing allRefs isn’t necessary anymore…

… but still there is that problematic issue where Nix 2.18 and Lix (nix (Lix, like Nix) 2.91.0/2.18.3-lix) exhibit that behaviour…

… which is made even more annoying when you see that if you get a Nix 2.24 to fetchGit it successfully, it then lives in the user’s evaluation cache for 2.18 to see.