From 58e435c47574f6805ff9b14964facc56d74367b6 Mon Sep 17 00:00:00 2001 From: jmug Date: Fri, 24 Jan 2025 16:51:51 -0800 Subject: [PATCH] Add a flake with OCaml 4.14.1 Signed-off-by: jmug --- .envrc | 1 + flake.lock | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 30 ++++++++++++++++++++ 3 files changed, 112 insertions(+) create mode 100644 .envrc create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..d5fef71 --- /dev/null +++ b/flake.lock @@ -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 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..3e5ea25 --- /dev/null +++ b/flake.nix @@ -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 + ]; + }; + } + ); +} +