Skip to content

Instantly share code, notes, and snippets.

@pete-murphy
Created April 17, 2023 00:10
Show Gist options
  • Save pete-murphy/d66ba0963cf7e7802541632ba44b7f79 to your computer and use it in GitHub Desktop.
Save pete-murphy/d66ba0963cf7e7802541632ba44b7f79 to your computer and use it in GitHub Desktop.
zbg nix flake debugging
{
inputs = {
flake-utils.url = "github:numtide/flake-utils";
# nixpkgs.follows = "opam-nix/nixpkgs";
nixpkgs.url = "github:NixOS/nixpkgs/master";
# nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
# opam-nix = {
# url = "github:tweag/opam-nix";
# inputs.nixpkgs.follows = "nixpkgs";
# };
};
outputs = { self, flake-utils, opam-nix, nixpkgs }@inputs:
# Don't forget to put the package name instead of `throw':
let package = "zbg";
in flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
on = opam-nix.lib.${system};
scope =
on.buildDuneProject { } package ./. { ocaml-base-compiler = "*"; };
overlay = final: prev:
{
# dune = prev.dune.overrideAttrs (_: { nativeBuildInputs = with pkgs; [dune_3]; });
# Your overrides go here
};
in {
legacyPackages = scope.overrideScope' overlay;
packages.default = self.legacyPackages.${system}.${package};
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment