first release
This commit is contained in:
commit
3393f1ecfe
16 changed files with 615 additions and 0 deletions
112
flake.nix
Normal file
112
flake.nix
Normal file
|
@ -0,0 +1,112 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.follows = "ocaml-overlay/nixpkgs";
|
||||
|
||||
ocaml-overlay = {
|
||||
url = "github:nix-ocaml/nix-overlays";
|
||||
};
|
||||
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
|
||||
nh.url = "github:viperML/nh";
|
||||
|
||||
lix = {
|
||||
url = "https://git.lix.systems/lix-project/lix/archive/main.tar.gz";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
lix-module = {
|
||||
url = "https://git.lix.systems/lix-project/nixos-module/archive/main.tar.gz";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.lix.follows = "lix";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = inputs @ {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
ocaml-overlay,
|
||||
...
|
||||
}: let
|
||||
inherit (inputs) nixpkgs;
|
||||
lix-overlay = inputs.lix-module.overlays.default;
|
||||
lix-module = inputs.lix-module.nixosModules.default;
|
||||
nh-overlay = inputs.nh.overlays.default;
|
||||
in
|
||||
flake-utils.lib.eachDefaultSystem (
|
||||
system: let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [
|
||||
ocaml-overlay.overlays.default
|
||||
lix-overlay
|
||||
nh-overlay
|
||||
];
|
||||
modules = [lix-module];
|
||||
extra-substituters = "https://anmonteiro.nix-cache.workers.dev";
|
||||
extra-trusted-public-keys = "ocaml.nix-cache.com-1:/xI2h2+56rwFfKyyFVbkJSeGqSIYMC/Je+7XXqGKDIY=";
|
||||
};
|
||||
minimal = let
|
||||
inherit (pkgs) ocaml-ng;
|
||||
inherit
|
||||
(ocaml-ng.ocamlPackages_5_2)
|
||||
dune_3
|
||||
ocaml
|
||||
;
|
||||
in [
|
||||
dune_3
|
||||
ocaml
|
||||
];
|
||||
dev = let
|
||||
inherit (pkgs) ocaml-ng;
|
||||
inherit
|
||||
(ocaml-ng.ocamlPackages_5_2)
|
||||
utop
|
||||
ocaml-lsp
|
||||
ocamlformat
|
||||
ocamlformat-rpc-lib
|
||||
;
|
||||
in [
|
||||
utop
|
||||
ocaml-lsp
|
||||
ocamlformat
|
||||
ocamlformat-rpc-lib
|
||||
];
|
||||
inherit (pkgs) lix nh;
|
||||
in {
|
||||
devShells.default = let
|
||||
inherit (pkgs) mkShell;
|
||||
in
|
||||
mkShell {
|
||||
buildInputs = minimal ++ dev ++ [lix nh];
|
||||
};
|
||||
|
||||
packages.default = pkgs.callPackage ./nix/default.nix {ocaml-deps = minimal;};
|
||||
|
||||
defaultPackage = self.packages.${system}.default;
|
||||
}
|
||||
)
|
||||
// {
|
||||
nixosModules.meat = import ./nix/module.nix {
|
||||
meatOverlays = [self.overlays.meat nh-overlay];
|
||||
lixModule = lix-module;
|
||||
};
|
||||
|
||||
overlays.meat = final: _prev: let
|
||||
ocaml-deps = let
|
||||
inherit (final) ocaml-ng;
|
||||
inherit
|
||||
(ocaml-ng.ocamlPackages_5_2)
|
||||
dune_3
|
||||
ocaml
|
||||
;
|
||||
in [
|
||||
dune_3
|
||||
ocaml
|
||||
];
|
||||
in {
|
||||
meat = final.callPackage ./nix/default.nix {inherit ocaml-deps;};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue