From bcb80df05106afa74c7149f74f3b8fabce052bac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alper=20=C3=87elik?= Date: Wed, 26 Apr 2023 10:33:29 +0300 Subject: [PATCH] add support for sourcehut --- default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/default.nix b/default.nix index f4f81dc..95674e3 100644 --- a/default.nix +++ b/default.nix @@ -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}'";