Skip to content

Commit

Permalink
chore(nix): Add nix flake (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
metame authored Mar 10, 2024
1 parent cb5d8f6 commit 1448c59
Show file tree
Hide file tree
Showing 3 changed files with 387 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
347 changes: 347 additions & 0 deletions flake.lock

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

36 changes: 36 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
description = "Raw bindings to platform APIs for OCaml.";
inputs.config.url = "github:ocaml-sys/config.ml";
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 = "libc";
version = "0.0.1";
in
{
devShells = {
default = mkShell {
buildInputs = [ ocamlPackages.utop ];
inputsFrom = [ self'.packages.default ];
};
};

packages = {
default = buildDunePackage {
inherit version;
pname = name;
propagatedBuildInputs = [
inputs'.config.packages.default
];
src = ./.;
};
};
};
};
}

0 comments on commit 1448c59

Please sign in to comment.