nixpkgs/pkgs/development/compilers/elm/makeDotElm.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
1.1 KiB
Nix
Raw Normal View History

2019-10-21 16:31:02 +02:00
{stdenv, lib, fetchurl, registryDat}:
ver: deps:
let cmds = lib.mapAttrsToList (name: info: let
pkg = stdenv.mkDerivation {
name = lib.replaceChars ["/"] ["-"] 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 ''
2019-10-21 16:31:02 +02:00
mkdir -p .elm/${ver}/packages/${name}
cp -R ${pkg} .elm/${ver}/packages/${name}/${info.version}
'') deps;
in (lib.concatStrings cmds) + ''
2019-10-21 16:31:02 +02:00
mkdir -p .elm/${ver}/packages;
cp ${registryDat} .elm/${ver}/packages/registry.dat;
chmod -R +w .elm
''