Skip to content

Commit

Permalink
chore: add nix support
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <[email protected]>

<!-- ps-id: 3e249e83-4756-475d-ac59-c1558e079557 -->
  • Loading branch information
rgrinberg committed Sep 26, 2023
1 parent cfa1f30 commit 204233f
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@ promote:
fmt:
dune build @fmt --auto-promote

.PHONY: nix/opam-selection.nix
nix/opam-selection.nix:
nix-shell -A resolve default.nix

.PHONY: default install uninstall reinstall clean test
76 changes: 76 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
description = "spawn Nix Flake";

inputs.nix-filter.url = "github:numtide/nix-filter";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nixpkgs.url = "github:nixos/nixpkgs";

outputs = { self, nixpkgs, flake-utils, nix-filter }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages."${system}";
inherit (pkgs.ocamlPackages) buildDunePackage;
in
rec {
packages = rec {
default = spawn;
spawn = buildDunePackage {
pname = "spawn";
version = "n/a";
src = ./.;
duneVersion = "3";
propagatedBuildInputs = with pkgs.ocamlPackages; [ ];
checkInputs = with pkgs.ocamlPackages; [ ppx_expect ppx_bench ];
doCheck = true;
};
};
devShells.default = pkgs.mkShell {
inputsFrom = pkgs.lib.attrValues packages;
buildInputs = with pkgs.ocamlPackages; [ ocaml-lsp pkgs.ocamlformat_0_19_0 ];
};
});
}

0 comments on commit 204233f

Please sign in to comment.