Skip to content

Commit

Permalink
Merge pull request #56 from Alper-Celik/master
Browse files Browse the repository at this point in the history
add support for sourcehut
  • Loading branch information
edolstra authored Oct 2, 2023
2 parents 5717e26 + bcb80df commit e654cc3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ let
);
shortRev = builtins.substring 0 7 info.rev;
}
else if info.type == "sourcehut" then
{ inherit (info) rev narHash lastModified;
outPath =
fetchTarball
({ url = "https://${info.host or "git.sr.ht"}/${info.owner}/${info.repo}/archive/${info.rev}.tar.gz"; }
// (if info ? narHash then { sha256 = info.narHash; } else {})
);
shortRev = builtins.substring 0 7 info.rev;
}
else
# FIXME: add Mercurial, tarball inputs.
throw "flake input has unsupported input type '${info.type}'";
Expand Down

0 comments on commit e654cc3

Please sign in to comment.