Closed rizo closed 2 years ago
Packages in the scope are just regular nixpkgs stdenv derivations, with mostly standard phase names. So you can do something like this:
let
scope = opam-nix.lib.${pkgs.system}.buildOpamProject {
inherit pkgs;
} "my_project" src { ocaml-system = null; };
overlay = self: super: {
my_project = super.my_project.overrideAttrs (oa: { buildPhase = "xxx"; });
};
in
(scope.overrideScope' overlay).my_project
This is documented in the readme: https://github.com/tweag/opam-nix#package
That makes sense, thanks. I thought the buildPhase
was internally more complicated than just calling opam's build
.
Is your feature request related to a problem? Please describe. Dune supports different build envs that can be used to pass custom compiler flags during compilation. Currently the installation will use the
build
attribute found in the opam file by default and there is no way to provide an alternativebuild
command (to use a custom env for example).Describe the solution you'd like After creating a scope I would like to be able to override the
build
attribute for my package.Currently the following does not work and still uses the
build
command from the opam file:Describe alternatives you've considered Alternatively maybe there is a way to adapt
buildDuneProject
to allow passing a custombuild
argument.