-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathflake.nix
31 lines (31 loc) · 1020 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
26
27
28
29
30
31
{
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;
});
}