Merge pull request #19 from marienz/fetch
Fix fetches with Nix 2.23's default shallow clones
This commit is contained in:
commit
4fc2df24bf
2 changed files with 23 additions and 2 deletions
17
default.nix
17
default.nix
|
|
@ -59,7 +59,7 @@
|
|||
}:
|
||||
let
|
||||
inherit (lib) optionalAttrs optionalString;
|
||||
inherit (import ./fetch-overrides.nix) extraPins extraUrls;
|
||||
inherit (import ./fetch-overrides.nix) extraPins extraUrls forceDeepCloneDomains;
|
||||
|
||||
# Step 1: determine which Emacs packages to pull in.
|
||||
#
|
||||
|
|
@ -260,7 +260,10 @@ let
|
|||
|
||||
}
|
||||
// optionalAttrs (p ? recipe.branch) { ref = p.recipe.branch; }
|
||||
// optionalAttrs (p ? recipe.depth) { shallow = p.recipe.depth == 1; };
|
||||
// optionalAttrs (p ? recipe.depth) { shallow = p.recipe.depth == 1; }
|
||||
// optionalAttrs (lib.any (d: lib.hasPrefix d url) forceDeepCloneDomains) {
|
||||
shallow = false;
|
||||
};
|
||||
src =
|
||||
if experimentalFetchTree
|
||||
then builtins.fetchTree (
|
||||
|
|
@ -274,6 +277,16 @@ let
|
|||
type = "github";
|
||||
inherit owner repo;
|
||||
rev = pin;
|
||||
} else if lib.hasPrefix "https://git.sr.ht/" url
|
||||
then let
|
||||
tail = lib.removePrefix "https://git.sr.ht/" url;
|
||||
split = lib.splitString "/" tail;
|
||||
owner = lib.head split;
|
||||
repo = lib.elemAt split 1;
|
||||
in {
|
||||
type = "sourcehut";
|
||||
inherit owner repo;
|
||||
rev = pin;
|
||||
} else ({
|
||||
type = "git";
|
||||
} // fetchGitArgs))
|
||||
|
|
|
|||
|
|
@ -54,4 +54,12 @@
|
|||
# CI should fail again the next time Doom updates magit, so this won't go stale.
|
||||
git-commit = "ea0f07e54967197ac0b072a69ba314314a4080c1";
|
||||
};
|
||||
|
||||
# Domains for which to force `shallow = false`.
|
||||
forceDeepCloneDomains = [
|
||||
"https://git.notmuchmail.org/"
|
||||
"https://git.savannah.gnu.org/"
|
||||
"https://git.sr.ht/"
|
||||
"https://codeberg.org/"
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue