Add a flake with OCaml 4.14.1

Signed-off-by: jmug <u.g.a.mariano@gmail.com>
This commit is contained in:
Mariano Uvalle 2025-01-24 16:51:51 -08:00
parent e855a12916
commit 58e435c475
3 changed files with 112 additions and 0 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use flake

81
flake.lock generated Normal file
View file

@ -0,0 +1,81 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": [
"systems"
]
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1737761447,
"narHash": "sha256-iF7lFu65s358zskK12Zd8mY68mU8EdEKfEyflvsC94U=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8827312350044725e010d9fe11dc50869f1c64f8",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "release-24.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-ocaml": {
"locked": {
"lastModified": 1705204527,
"narHash": "sha256-WVz9WdaFBhAwO/7A+HlW8HPJ4VQ8QnpCD1WZAcAPneo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "dd5621df6dcb90122b50da5ec31c411a0de3e538",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "dd5621df6dcb90122b50da5ec31c411a0de3e538",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"nixpkgs-ocaml": "nixpkgs-ocaml",
"systems": "systems"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

30
flake.nix Normal file
View file

@ -0,0 +1,30 @@
{
description = "flake for OCaml dev";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/release-24.11";
nixpkgs-ocaml.url = "github:NixOS/nixpkgs/dd5621df6dcb90122b50da5ec31c411a0de3e538"; # OCaml 4.14.1
systems.url = "github:nix-systems/default";
flake-utils = {
url = "github:numtide/flake-utils";
inputs.systems.follows = "systems";
};
};
outputs =
{ nixpkgs, nixpkgs-ocaml, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
ocaml-pkgs = nixpkgs-ocaml.legacyPackages.${system};
in
{
devShells.default = pkgs.mkShell {
packages = with pkgs; [
ocaml-pkgs.ocaml
];
};
}
);
}