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: #358
Relates-to: NixOS/nix#5128
  • Loading branch information
László Vaskó authored and adisbladis committed Jan 17, 2022
1 parent a47cc10 commit 5c06704
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 @@ -169,11 +169,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 (lib.versionAtLeast nixVersion "2.4") {
allRefs = true;
}
))
)
else if isUrl then
builtins.fetchTarball
Expand Down

0 comments on commit 5c06704

Please sign in to comment.