summaryrefslogtreecommitdiff
path: root/custom/prosody-modules.nix
blob: 3c1034382bf7341bece356bb25c5fecbe744d880 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{ stdenv
, fetchhg
, modules ? []
}:

let
  copyModule = name: "cp -rv $src/${name}/* $out/;";
  concat = a: b: a + b;
  head = ''
    source $stdenv/setup
    mkdir -p $out
  '';
in stdenv.mkDerivation {
  name = "prosody-modules";
  src = fetchhg {
    url = "http://hg.prosody.im/prosody-modules";
    sha256 = "0nsf1j2prc6ggajn7zz9h300msf6aajqqxhy396g7j834knj5fb2";
  };
  builder = builtins.toFile "builder.sh" (head + (builtins.foldl' concat "" (map copyModule modules)));
}