summary refs log tree commit diff
path: root/pkgs/build-support/fetchmtn/default.nix
blob: daead9ad6d2db2deb187e1bd15e3569014a54bfe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# You can specify some extra mirrors and a cache DB via options
{stdenv, monotone, defaultDBMirrors ? [], cacheDB ? "./mtn-checkout.db"}:
# 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 ? [], sha256
, selector ? "h:" + branch, branch}:

stdenv.mkDerivation {
  builder = ./builder.sh;
  nativeBuildInputs = [monotone];

  outputHashAlgo = "sha256";
  outputHashMode = "recursive";
  outputHash = sha256;

  dbs = defaultDBMirrors ++ dbs;
  inherit branch cacheDB name selector;

  impureEnvVars = [
    # We borrow these environment variables from the caller to allow
    # easy proxy configuration.  This is impure, but a fixed-output
    # derivation like fetchurl is allowed to do so since its result is
    # by definition pure.
    "http_proxy" "https_proxy" "ftp_proxy" "all_proxy" "no_proxy"
    ];
}