21 Commits

Author SHA1 Message Date
George Thomas
cf9e36e9df bump to hs-bindgen and libclang to latest...
had hoped this might solve the weird field naming but alas - should just report issue
2026-04-15 01:40:47 +01:00
George Thomas
5b37b69c5b Get Rust Analyzer from overlay instead of directly from Nixpkgs
Right now, the latter invokes `cargo metadata --lockfile-path`,
which this Cargo nightly doesn't support.
2026-04-15 01:40:47 +01:00
George Thomas
1546ee152c Remove unnecessary library linking 2026-04-15 01:40:47 +01:00
George Thomas
ef6e8b9605 Specify include directories via environment variable 2026-04-15 01:40:47 +01:00
George Thomas
8d4f9c7ca0 Minor refactor to avoid long line 2026-04-15 01:40:47 +01:00
George Thomas
ccdf4a9bce Combine overrides 2026-04-15 01:40:47 +01:00
George Thomas
e0adce3802 Inline project Nix file 2026-04-15 01:40:47 +01:00
George Thomas
18a8b04537 Remove unused binding 2026-04-15 01:40:47 +01:00
George Thomas
b6a3b56f7f Bump hs-bindgen to avoid header patching hack 2026-04-15 01:40:47 +01:00
George Thomas
fd8baf949f stuff from Yuri 2026-04-15 01:40:40 +01:00
George Thomas
c228354a13 Use nix-haskell and provide source-repository-packages to Cabal in shell 2026-03-24 16:01:44 +00:00
George Thomas
b68d6257d3 Move bindings generation to Rust build script 2026-03-24 11:24:40 +00:00
George Thomas
718554cb2e Bump hs-bindgen for record-dot support 2026-03-19 11:34:50 +00:00
George Thomas
96ec5c1cb1 Switch to Template Haskell mode for hs-bindgen 2026-02-20 09:08:16 +00:00
George Thomas
2bab0ff94e Rename Haskell.nix flake input 2026-02-19 16:29:52 +00:00
George Thomas
56370bb8a4 Reformat 2026-02-19 16:29:52 +00:00
George Thomas
b9e2e59174 Refactor Nix flake inputs 2026-02-19 16:29:52 +00:00
George Thomas
f1ec06fcca Add Bash script dependencies to Nix shell 2026-02-19 16:29:52 +00:00
George Thomas
7bb41f6825 Call Rust from Haskell with cargo-cabal and hs-bindgen
See https://sraka.xyz/posts/hs-bindgen-introduction.html.

For now, this is a shell-based workflow, rather than using Nix to build everything, i.e. `nix develop` works but `nix build` doesn't. And `cargo build` has to be called manually to create the C library, rather than `cabal` being clever enough to invoke it itself.

We ran `cargo cabal init` from the `rust` directory (`nix shell github:yvan-sraka/cargo-cabal`), which generated `hsbindgen.toml` (which we use), and `Setup.lhs` (which just added `extra-lib-dirs`, and with the wrong paths, so we dspecify those statically instead in `garnet.cabal`). We also follow its advice to use `staticlib`.

Also, after we ran the first `cargo build` (requiring a `mkdir rust/src` before it would run), we took the generated the Haskell file, and moved the main contents in to `Main.hs` manually.
2026-02-19 13:57:14 +00:00
George Thomas
2640c75baf Format Nix file 2026-02-18 14:31:54 +00:00
39283930d5 Initial 2026-02-17 14:57:34 +00:00