push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,111 @@
{
lib,
repoRevToNameMaybe,
fetchgit,
fetchzip,
}:
lib.makeOverridable (
{
owner,
repo,
tag ? null,
rev ? null,
name ? repoRevToNameMaybe repo (lib.revOrTag rev tag) "bitbucket",
fetchSubmodules ? false,
leaveDotGit ? false,
deepClone ? false,
forceFetchGit ? false,
fetchLFS ? false,
rootDir ? "",
sparseCheckout ? lib.optional (rootDir != "") rootDir,
meta ? { },
... # For hash agility
}@args:
assert (
lib.assertMsg (lib.xor (tag == null) (
rev == null
)) "fetchFromBitbucket requires one of either `rev` or `tag` to be provided (not both)."
);
let
position = (
if args.meta.description or null != null then
builtins.unsafeGetAttrPos "description" args.meta
else if tag != null then
builtins.unsafeGetAttrPos "tag" args
else
builtins.unsafeGetAttrPos "rev" args
);
baseUrl = "https://bitbucket.org/${owner}/${repo}";
newMeta =
meta
// {
homepage = meta.homepage or baseUrl;
}
// lib.optionalAttrs (position != null) {
# to indicate where derivation originates, similar to make-derivation.nix's mkDerivation
position = "${position.file}:${toString position.line}";
};
gitRepoUrl = "${baseUrl}.git";
# the tag is escaped to support mercurial-based tags as bitbucket supports them
revWithTag = if tag != null then "refs/tags/${lib.strings.escapeURL tag}" else rev;
passthruAttrs = removeAttrs args [
"owner"
"repo"
"rev"
"tag"
"fetchSubmodules"
"forceFetchGit"
];
useFetchGit =
fetchSubmodules
|| (leaveDotGit == true)
|| deepClone
|| forceFetchGit
|| fetchLFS
|| (rootDir != "")
|| (sparseCheckout != [ ]);
fetcher = if useFetchGit then fetchgit else fetchzip;
fetcherArgs =
(
if useFetchGit then
{
inherit
rev
tag
deepClone
fetchSubmodules
sparseCheckout
fetchLFS
;
url = gitRepoUrl;
}
// lib.optionalAttrs (leaveDotGit != null) { inherit leaveDotGit; }
else
{
url = "https://bitbucket.org/${owner}/${repo}/get/${revWithTag}.tar.gz";
extension = "tar.gz";
passthru = {
inherit gitRepoUrl;
};
}
)
// passthruAttrs
// {
inherit name;
};
in
fetcher fetcherArgs
// {
meta = newMeta;
inherit owner repo tag;
rev = revWithTag;
}
)

View File

@@ -0,0 +1,27 @@
{ testers, fetchFromBitbucket, ... }:
{
withEncodedWhitespace = testers.invalidateFetcherByDrvHash fetchFromBitbucket {
name = "withWhitespace";
owner = "tetov";
repo = "fetchbitbucket_tester";
tag = "tag%20with%20encoded%20spaces";
sha256 = "sha256-Nf1Cvbx7Sbab8EeSSBU5baLBiuFYiQtITED+f4tfjC0=";
};
withEncodedWhitespaceGit = testers.invalidateFetcherByDrvHash fetchFromBitbucket {
name = "withWhitespaceGit";
owner = "tetov";
repo = "fetchbitbucket_tester";
tag = "tag%20with%20encoded%20spaces";
sha256 = "sha256-Nf1Cvbx7Sbab8EeSSBU5baLBiuFYiQtITED+f4tfjC0=";
forceFetchGit = true;
};
withoutWhitespace = testers.invalidateFetcherByDrvHash fetchFromBitbucket {
name = "withoutWhitespace";
owner = "tetov";
repo = "fetchbitbucket_tester";
rev = "6b611eb75c7b3bf04b510dfc1268284039d55542";
sha256 = "sha256-eTd773gE1z4+Fl2YPBbbsrADD4Dr7sFGoOWgphXUhtE=";
};
}