Skip to content

Commit

Permalink
chore: Add nix flake (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
metame authored Feb 27, 2024
1 parent 5560133 commit 4bd0113
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
_build
# nix ignores
.direnv
result
.envrc
63 changes: 63 additions & 0 deletions flake.lock

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

34 changes: 34 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
description = "A pure OCaml library for working with terminals";

inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";

outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];
perSystem = { config, self', inputs', pkgs, system, ... }:
let
inherit (pkgs) ocamlPackages mkShell;
inherit (ocamlPackages) buildDunePackage;
name = "tty";
version = "0.0.2";
in
{
devShells = {
default = mkShell {
buildInputs = [ ocamlPackages.utop ];
inputsFrom = [ self'.packages.default ];
};
};

packages = {
default = buildDunePackage {
inherit version;
pname = name;
propagatedBuildInputs = with ocamlPackages; [ uutf ];
src = ./.;
};
};
};
};
}

0 comments on commit 4bd0113

Please sign in to comment.