Closed kentookura closed 11 months ago
{
inputs = {
opam-nix.url = "github:tweag/opam-nix";
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.follows = "opam-nix/nixpkgs";
opam-repository.url = "github:ocaml/opam-repository";
opam-repository.flake = false;
forester.url = "sourcehut:~jonsterling/ocaml-forester";
asai.url = "github:RedPRL/asai";
asai.flake = false;
forester.flake = false;
};
outputs = { self, asai, flake-utils, opam-repository, forester, opam-nix, nixpkgs }@inputs:
let
package = "forester";
in
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
on = opam-nix.lib.${system};
devPackagesQuery = {
asai = "*";
};
query = devPackagesQuery // {
ocaml-base-compiler = "*";
};
scope = on.buildOpamProject' { repos = [ "${opam-repository}" asai ]; } forester query;
overlay = final: prev: { };
scope' = scope.overrideScope' overlay;
main = scope'.${package};
devPackages = builtins.attrValues
(pkgs.lib.getAttrs (builtins.attrNames devPackagesQuery) scope');
in
{
legacyPackages = scope';
packages.default = main;
});
}
I believe you just needed a newer version of opam-repository
than the one pinned in opam-nix
, since it does contain the asai package.
This flake currently fails to build:
The package is not contained in opam-repo but should be installable with opam: https://ocaml.org/p/asai/0.2.0 The source of the package is here: https://github.com/RedPRL/asai
Is it possible to build
asai
from the repo and add it to the build inputs forforester
?Thanks!