depot/third_party/nixpkgs/pkgs/build-support/fetchmtn/default.nix
Default email 472aeafc57 Project import generated by Copybara.
GitOrigin-RevId: c31898adf5a8ed202ce5bea9f347b1c6871f32d1
2024-10-04 18:56:33 +02:00

24 lines
707 B
Nix

# You can specify some extra mirrors and a cache DB via options
{lib, stdenvNoCC, monotone, defaultDBMirrors ? [], cacheDB ? "./mtn-checkout.db"}:
lib.fetchers.withNormalizedHash { } (
# dbs is a list of strings, each is an url for sync
# selector is mtn selector, like h:org.example.branch
{name ? "mtn-checkout", dbs ? []
, outputHash, outputHashAlgo
, selector ? "h:" + branch, branch}:
stdenvNoCC.mkDerivation {
builder = ./builder.sh;
nativeBuildInputs = [monotone];
inherit outputHash outputHashAlgo;
outputHashMode = "recursive";
dbs = defaultDBMirrors ++ dbs;
inherit branch cacheDB name selector;
impureEnvVars = lib.fetchers.proxyImpureEnvVars;
}
)