05a2dfd674
replaceStrings has been in nix since 2015(nix 1.10)
so it is safe to remove the fallback
d6d5885c15
35 lines
1.1 KiB
Nix
35 lines
1.1 KiB
Nix
{stdenv, lib, fetchurl, registryDat}:
|
|
|
|
ver: deps:
|
|
let cmds = lib.mapAttrsToList (name: info: let
|
|
pkg = stdenv.mkDerivation {
|
|
name = lib.replaceStrings ["/"] ["-"] name + "-${info.version}";
|
|
|
|
src = fetchurl {
|
|
url = "https://github.com/${name}/archive/${info.version}.tar.gz";
|
|
meta.homepage = "https://github.com/${name}/";
|
|
inherit (info) sha256;
|
|
};
|
|
|
|
configurePhase = ''
|
|
true
|
|
'';
|
|
|
|
buildPhase = ''
|
|
true
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir -p $out
|
|
cp -r * $out
|
|
'';
|
|
};
|
|
in ''
|
|
mkdir -p .elm/${ver}/packages/${name}
|
|
cp -R ${pkg} .elm/${ver}/packages/${name}/${info.version}
|
|
'') deps;
|
|
in (lib.concatStrings cmds) + ''
|
|
mkdir -p .elm/${ver}/packages;
|
|
cp ${registryDat} .elm/${ver}/packages/registry.dat;
|
|
chmod -R +w .elm
|
|
''
|