From a0bdac47f79bc039dc052a5b458e606835df14ad Mon Sep 17 00:00:00 2001 From: Marien Zwart Date: Sun, 26 May 2024 13:38:46 +1000 Subject: [PATCH] Handle non-github git recipes Used by ob-clojure-literate. Noticed through upcoming test coverage improvement. --- default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/default.nix b/default.nix index 804c26d..0c8f523 100644 --- a/default.nix +++ b/default.nix @@ -229,10 +229,16 @@ let url = if (p.recipe.host or "") == "github" && p ? recipe.repo then "https://github.com/${p.recipe.repo}" + else if (p.recipe.type or "") == "git" + && p ? recipe.repo + && (p.recipe.host or null) == null + then p.recipe.repo else epkg.src.gitRepoUrl or extraUrls.${name} or (if isElpa then "https://github.com/emacs-straight/${name}" - else (throw "${name}: cannot derive url from recipe ${p.recipe or ""}")); + else (let + recipe = lib.generators.toPretty {} (p.recipe or "missing"); + in throw "${name}: cannot derive url from recipe ${recipe}")); # Use builtins.fetchGit instead of nixpkgs's fetchFromGitHub because # fetchGit allows fetching a specific git commit without a hash. fetchGitArgs = {