-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathflake.nix
34 lines (32 loc) · 1.09 KB
/
flake.nix
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
31
32
33
34
# Static build using the compiler from OPAM
{
inputs.opam-nix.url = "github:tweag/opam-nix";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.opam2json.url = "github:tweag/opam2json";
outputs =
{
self,
opam-nix,
opam2json,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (system: {
legacyPackages =
let
inherit (opam-nix.lib.${system}) buildOpamProject;
pkgs = opam-nix.inputs.nixpkgs.legacyPackages.${system};
scope = buildOpamProject { pkgs = pkgs.pkgsStatic; } "opam2json" opam2json {
ocaml-base-compiler = "*"; # This makes opam choose the non-system compiler
};
overlay = self: super: {
# Prevent unnecessary dependencies on the resulting derivation
opam2json = super.opam2json.overrideAttrs (_: {
removeOcamlReferences = true;
postFixup = "rm -rf $out/nix-support";
});
};
in
scope.overrideScope' overlay;
defaultPackage = self.legacyPackages.${system}.opam2json;
});
}