mirror of
https://github.com/vale981/poetry2nix
synced 2025-03-04 16:51:40 -05:00
fetchGit: work-around bug in Nix 2.4
Another approach to make `poetry2nix` work with dependencies specified by arbitrary `rev=<hash>` values on newer Nix revisions. Relates-to: https://github.com/nix-community/poetry2nix/pull/358 Relates-to: https://github.com/NixOS/nix/issues/5128
This commit is contained in:
parent
a47cc109f8
commit
5c06704d45
1 changed files with 9 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue