Skip to content

Commit

Permalink
fetchGit: work-around bug in Nix 2.4
Browse files Browse the repository at this point in the history
Another approach to make `poetry2nix` work with dependencies specified
by arbitrary `rev=<hash>` values on newer Nix revisions.

Relates-to: nix-community#358
Relates-to: NixOS/nix#5128
  • Loading branch information
László Vaskó committed Oct 20, 2021
1 parent e96faf1 commit b1b3c26
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions mk-poetry-dep.nix
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,18 @@ pythonPackages.callPackage
src =
if isGit then
(
builtins.fetchGit {
builtins.fetchGit ({
inherit (source) url;
rev = source.resolved_reference or source.reference;
ref = sourceSpec.branch or sourceSpec.rev or (if sourceSpec?tag then "refs/tags/${sourceSpec.tag}" else "HEAD");
}
} // (
let
nixVersion = builtins.substring 0 3 builtins.nixVersion;
in
lib.optionalAttrs (builtins.compareVersions nixVersion "2.4" >= 0) {
allRefs = true;
}
))
)
else if isUrl then
builtins.fetchTarball
Expand Down

0 comments on commit b1b3c26

Please sign in to comment.