From 20340f323c0e4bb8361b3eedb15fb49e1e49d92e Mon Sep 17 00:00:00 2001 From: butterunderflow Date: Sun, 1 Sep 2024 03:19:41 +0800 Subject: [PATCH] (WIP)try to use nix --- default.nix | 17 +++++++++++++++++ shell.nix | 2 ++ 2 files changed, 19 insertions(+) create mode 100644 default.nix create mode 100644 shell.nix diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..ff5c5d1 --- /dev/null +++ b/default.nix @@ -0,0 +1,17 @@ +let + pkgs = import { }; + stdenv = pkgs.stdenv; +in { + shell = pkgs.mkShell { + name = "fun-for-fun"; + args = [ "build" ]; + src = [ ./lib ./dune-project ]; + system = builtins.currentSystem; + buildInputs = with pkgs; [ opam cmake ]; + # fixme: I failed to install package by package manager outside nix, maybe it's bad practice. + # shellHooks = '' + # opam install . --deps-only --with-test --yes + # opam install merlin --yes + # ''; + }; +} diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..1bdf221 --- /dev/null +++ b/shell.nix @@ -0,0 +1,2 @@ + +(import ./default.nix).shell