2020-05-20 18:07:39 +04:00
|
|
|
# nixpkgs extended with all the overlays for LIGO
|
2020-03-25 22:14:18 +04:00
|
|
|
{ sources ? import ./sources.nix }:
|
|
|
|
let
|
|
|
|
ocaml-overlay = import ./ocaml-overlay.nix { inherit sources; };
|
|
|
|
static-overlay = import ./static-overlay.nix pkgs;
|
|
|
|
mac-overlay = import ./mac-overlay.nix;
|
|
|
|
nodejs-overlay = import ./nodejs-overlay.nix;
|
2020-05-20 18:07:39 +04:00
|
|
|
nix-npm-buildpackage = pkgs.callPackage sources.nix-npm-buildpackage { };
|
|
|
|
|
2020-03-25 22:14:18 +04:00
|
|
|
pkgs = import sources.nixpkgs {
|
|
|
|
overlays = [ ocaml-overlay nodejs-overlay ]
|
2020-05-20 18:07:39 +04:00
|
|
|
# This is done here to prevent the need for bootstrap nixpkgs
|
2020-03-25 22:14:18 +04:00
|
|
|
++ (if builtins.currentSystem == "x86_64-darwin"
|
|
|
|
then [ mac-overlay ]
|
|
|
|
else [ ]);
|
|
|
|
};
|
2020-05-20 18:07:39 +04:00
|
|
|
|
|
|
|
# Takes $pkg/ligo and creates a new package with $pkg/bin/ligo
|
2020-03-25 22:14:18 +04:00
|
|
|
separateBinary = pkg:
|
|
|
|
pkgs.runCommandNoCC "${pkg.name}-bin" { }
|
|
|
|
"mkdir -p $out/bin; cp -Lr ${pkg}/ligo $out/bin";
|
|
|
|
|
2020-05-25 19:47:40 +04:00
|
|
|
|
|
|
|
tmp = pkgs.runCommandNoCC "tmpdir" { } "mkdir -p $out/tmp";
|
|
|
|
|
2020-03-25 22:14:18 +04:00
|
|
|
in pkgs.extend (self: super: {
|
|
|
|
inherit (self.ocamlPackages) ligo ligo-out ligo-tests ligo-doc ligo-coverage;
|
|
|
|
ligo-bin = separateBinary self.ligo-out.bin;
|
|
|
|
ligo-docker = self.callPackage ./docker.nix { ligo = self.ligo-bin; };
|
|
|
|
ligo-deb = self.callPackage ./packageDeb.nix { };
|
|
|
|
ligo-editor = self.callPackage ./ligo-editor.nix { inherit sources; };
|
|
|
|
ligo-editor-docker = self.callPackage ./docker.nix {
|
|
|
|
ligo = self.ligo-editor;
|
|
|
|
name = "ligo-editor";
|
2020-05-25 19:47:40 +04:00
|
|
|
extraContents = [ tmp ];
|
2020-03-25 22:14:18 +04:00
|
|
|
};
|
|
|
|
ligo-website = self.callPackage ./ligo-website.nix {
|
|
|
|
inherit (nix-npm-buildpackage) buildNpmPackage;
|
|
|
|
};
|
|
|
|
ligo-static = self.pkgsMusl.ligo-bin;
|
|
|
|
pkgsMusl = super.pkgsMusl.extend static-overlay;
|
|
|
|
})
|