summaryrefslogtreecommitdiff
path: root/devenv.nix
diff options
context:
space:
mode:
authorpolwex <polwex@sortug.com>2025-06-14 23:30:34 +0700
committerpolwex <polwex@sortug.com>2025-06-14 23:30:34 +0700
commitd8b3e15bec60f58defad13e961f80354d250235d (patch)
tree6a6f9158141bf40ea452a5913d72160362e0c472 /devenv.nix
aaaaaa
Diffstat (limited to 'devenv.nix')
-rw-r--r--devenv.nix166
1 files changed, 166 insertions, 0 deletions
diff --git a/devenv.nix b/devenv.nix
new file mode 100644
index 0000000..dc5f298
--- /dev/null
+++ b/devenv.nix
@@ -0,0 +1,166 @@
+{
+ pkgs,
+ lib,
+ config,
+ inputs,
+ ...
+}: let
+ oopkgs = import inputs.nix-ocaml {system = pkgs.system;};
+ opkgs = oopkgs.ocamlPackages;
+
+ ocaml-quickjs = opkgs.buildDunePackage {
+ name = "quickjs";
+ pname = "quickjs";
+ version = "0.1.1";
+ # src = pkgs.fetchFromGitHub {
+ # owner = "dhcmrlchtdj";
+ # repo = "ocaml-quickjs";
+ # rev = "master";
+ # sha256 = "sha256-CIMxkElHW6GARt8WKe+mr+G/MNkMfxvP/Q6yI1nFG+M=";
+ # };
+ # src = inputs.quickjs-ml;
+ # src = pkgs.fetchFromGitHub {
+ # fetchSubmodules = true;
+ # owner = "ml-in-barcelona";
+ # repo = "quickjs.ml";
+ # rev = "master";
+ # sha256 = "zS1kBkpg6mipGr8IGS5tRP//Hws5EhDhT1Izc2DuwT0=";
+ # };
+ src = ./quickjs.ml;
+ # src = builtins.fetchurl {
+ # url = "https://github.com/ml-in-barcelona/quickjs.ml?submodules=1";
+ # sha256 = "0szmgj980l3jah5lsz63fpniz34sr5rabhriv0srv58wp8qh858h";
+ # };
+ doCheck = true;
+ buildInputs = [pkgs.git];
+ propagatedBuildInputs = [
+ pkgs.git
+ opkgs.alcotest
+ opkgs.integers
+ opkgs.ctypes
+ ];
+ };
+ melange-json-native = opkgs.buildDunePackage {
+ pname = "melange-json-native";
+ version = "1.3.0";
+ src = builtins.fetchurl {
+ url = "https://github.com/melange-community/melange-json/releases/download/2.0.0/melange-json-2.0.0.tbz";
+ sha256 = "1n1avcplidrigkch4y8lnh136g5q06d0xhgzvgips3y399lw2jah";
+ };
+ propagatedBuildInputs = with opkgs; [ppxlib yojson];
+ };
+
+ server-reason-react = opkgs.buildDunePackage {
+ pname = "server-reason-react";
+ version = "n/a";
+ doCheck = true;
+
+ src = ./srr;
+ # src = pkgs.fetchFromGitHub {
+ # owner = "ml-in-barcelona";
+ # repo = "server-reason-react";
+ # rev = "d5dd436b0a447ff0a82f9a8d7a02f102139299a9";
+ # sha256 = "sha256-CIMxkElHW6GARt8WKe+mr+G/MNkMfxvP/Q6yI1nFG+M=";
+ # };
+ nativeBuildInputs = with opkgs; [
+ ocamlformat
+ reason
+ melange
+ reason-native.refmterr
+ ];
+ propagatedBuildInputs =
+ (with opkgs; [
+ reason-react
+ reason-react-ppx
+ melange-json
+ melange-json-native
+ alcotest-lwt
+ ocamlformat
+ uucp
+ ocaml-quickjs
+ yojson
+ uri
+ melange
+ ocaml_pcre
+ lwt
+ lwt_ppx
+ ])
+ ++ [pkgs.nodejs];
+ };
+ # nix-ocaml = inputs.nix-ocaml.legacyPackages.${pkgs.system};
+in {
+ # https://devenv.sh/packages/
+ env.WTF = pkgs.lib.makeLibraryPath config.packages;
+ packages =
+ (with pkgs; [
+ git
+ watchexec
+ sqlite
+ pkg-config
+ coreutils-full
+ ])
+ ++ (with oopkgs; [ocaml opam dune_3])
+ ++ [
+ # server-reason-react
+ melange-json-native
+ ]
+ ++ (with opkgs; [
+ base
+ core
+ utop
+ ocamlformat
+ ocaml_sqlite3
+ eio
+ integers
+ uri
+ yojson
+ melange
+ dream
+ melange-webapi
+ melange-fetch
+ melange-json
+ reason
+ reason-react
+ ocaml-lsp
+ ppx_yojson_conv
+ ]);
+
+ # https://devenv.sh/languages/
+ languages.javascript = {
+ enable = true;
+ npm.enable = true;
+ };
+
+ # https://devenv.sh/processes/
+ # processes.cargo-watch.exec = "cargo-watch";
+
+ # https://devenv.sh/services/
+ # services.postgres.enable = true;
+
+ # https://devenv.sh/scripts/
+ scripts.hello.exec = ''
+ echo hello from $GREET
+ '';
+
+ enterShell = ''
+ hello
+ git --version
+ '';
+
+ # https://devenv.sh/tasks/
+ # tasks = {
+ # "myproj:setup".exec = "mytool build";
+ # "devenv:enterShell".after = [ "myproj:setup" ];
+ # };
+
+ # https://devenv.sh/tests/
+ enterTest = ''
+ echo "Running tests"
+ git --version | grep --color=auto "${pkgs.git.version}"
+ '';
+
+ # https://devenv.sh/git-hooks/
+ # git-hooks.hooks.shellcheck.enable = true;
+
+ # See full reference at https://devenv.sh/reference/options/
+}