-
Notifications
You must be signed in to change notification settings - Fork 32
/
flake.nix
25 lines (25 loc) · 953 Bytes
/
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
{
description =
"Build a package from opam-repository, linked statically (on Linux)";
inputs.opam-nix.url = "github:tweag/opam-nix";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, opam-nix, flake-utils }:
flake-utils.lib.eachDefaultSystem (system: {
legacyPackages = let
inherit (opam-nix.lib.${system}) queryToScope;
pkgs = opam-nix.inputs.nixpkgs.legacyPackages.${system};
scope = queryToScope { pkgs = pkgs.pkgsStatic; } {
opam-ed = "*";
ocaml-system = "*";
};
overlay = self: super: {
# Prevent unnecessary dependencies on the resulting derivation
opam-ed = super.opam-ed.overrideAttrs (_: {
removeOcamlReferences = true;
postFixup = "rm -rf $out/nix-support";
});
};
in scope.overrideScope' overlay;
defaultPackage = self.legacyPackages.${system}.opam-ed;
});
}