Skip to content

Commit

Permalink
chore: Add nix flake (#1)
Browse files Browse the repository at this point in the history
* Add nix flake

* Nix: edit description
  • Loading branch information
metame authored Feb 27, 2024
1 parent 9f61f9f commit 736ab26
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
_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.

38 changes: 38 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
description = "A pure OCaml library for manipulating colors in different color spaces";

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 = "colors";
version = "0.0.1";
in
{
devShells = {
default = mkShell {
buildInputs = [ ocamlPackages.utop ];
inputsFrom = [ self'.packages.default ];
};
};

packages = {
default = buildDunePackage {
inherit version;
pname = name;
propagatedBuildInputs = with ocamlPackages; [
(mdx.override {
inherit logs;
})
];
src = ./.;
};
};
};
};
}

0 comments on commit 736ab26

Please sign in to comment.