Skip to content

Commit

Permalink
chore(nix): add nix flake (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
metame authored Mar 9, 2024
1 parent 164d23b commit 4c7b75b
Show file tree
Hide file tree
Showing 3 changed files with 320 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
_build
*.install
_build
# nix ignores
.direnv
result
.envrc
276 changes: 276 additions & 0 deletions flake.lock

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

39 changes: 39 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
description = "Conditional compilation via attributes for OCaml";

inputs.minttea.url = "github:leostera/minttea";
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 = "config";
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; [
inputs'.minttea.packages.spices
sedlex
ppxlib
];
src = ./.;
};
};
};
};
}

0 comments on commit 4c7b75b

Please sign in to comment.