From cd4f383303700146524d367e8178e50a44d3cfd5 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Mon, 8 Dec 2025 23:36:55 +0100 Subject: home/packages: add forester this was much too much work. to summarise: - ocamlc is weird and does not at all play nice with nix - nixpkgs.ocamlPackages seems to not have any good way to deal with multiple package versions, and forester needs several different versions than are in nixpkgs - forester itself has a flake which one is supposed to use with Nix; it uses tweag's opam-nix construct - which for some bizarre reason cannot be imported the way I import all my other flakes, and I do not understand why - so I gave up for now and import it via flake-compat, unfortunately tying me to an old nixpkgs pin (~June), which hopefully does not influence too much of the output - forester's flake's default output is a cross-compiled musl version (???) - so use the one in legacyPackages instead --- inputs.nix | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'inputs.nix') diff --git a/inputs.nix b/inputs.nix index b31981b..9cb3bf3 100644 --- a/inputs.nix +++ b/inputs.nix @@ -65,5 +65,30 @@ let lix-overlay = import "${sources.lix-nixos-module}/overlay.nix" { lix = sources.lix // { rev = sources.lix.revision; }; }; + + + ###### Forester stuff + + flake-compat = import sources.flake-compat; + + # currently unused + opam2json = callFlake "opam2json" { + nixpkgs = nixpkgs-flake; + }; + # opam-nix does not want to be called like this; i do not know why + # opam-nix = callFlake "opam-nix"{ + # inherit (sources) opam-repository opam-overlays mirage-opam-overlays; + # inherit (inputs) flake-utils opam2json flake-compat; + # nixpkgs = nixpkgs-unstable-flake; + # }; + # so i gave up an use the flake-compat'd version instead, which uses an + # old nixpkgs pin i cannot easily change ... + opam-nix = (flake-compat { src = sources.opam-nix.outPath; }).defaultNix; + + ocaml-forester = callFlake "ocaml-forester" { + nixpkgs = nixpkgs-flake; + inherit (inputs) opam-nix flake-utils; + inherit (sources) opam-repository; + }; }; in inputs -- cgit v1.2.3