From 4c573289b59fa4aac59d038e6b03709989359e06 Mon Sep 17 00:00:00 2001 From: Emin Arslan Date: Fri, 3 Apr 2026 20:33:26 +0300 Subject: [PATCH] build: separated the nix flake and derivation, to allow for simpler builds and more flexibility --- default.nix | 9 +++++++++ flake.nix | 17 +---------------- 2 files changed, 10 insertions(+), 16 deletions(-) create mode 100644 default.nix diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..692c976 --- /dev/null +++ b/default.nix @@ -0,0 +1,9 @@ +{ pkgs ? import {}, ...}: + +pkgs.ocamlPackages.buildDunePackage { + pname = "ollisp"; + version = "0.0.1"; + src = pkgs.lib.cleanSource ./.; + nativeBuildInputs = with pkgs.ocamlPackages; [findlib menhir dune_3 ocaml]; + buildInputs = with pkgs.ocamlPackages; []; +} diff --git a/flake.nix b/flake.nix index 867c854..35ef43f 100644 --- a/flake.nix +++ b/flake.nix @@ -9,23 +9,8 @@ flake-utils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages.${system}; - devInputs = with pkgs.ocamlPackages; [merlin]; - ocamlPkgs = with pkgs.ocamlPackages; [menhir dune_3]; - libs = with pkgs.ocamlPackages; [findlib]; - nativeInputs = with pkgs; ocamlPkgs ++ [ocaml]; in { - packages.default = (pkgs.ocamlPackages.buildDunePackage { - pname = "ollisp"; - version = "0.0.1"; - src = pkgs.lib.cleanSource ./.; - nativeBuildInputs = nativeInputs; - buildInputs = libs; - }); - - devShells.default = pkgs.mkShell { - nativeBuildInputs = nativeInputs ++ devInputs; - buildInputs = libs; - }; + packages.default = pkgs.callPackage ./default.nix {}; }); }