I am currently trying to create a flake for LibVFIO’s arcd tool which is written in Nim. I have a repo with a flake.nix added here. I originally manually packaged all the dependencies listed in libvfio.nimble, but after some trouble I switched to nimble2nix, which unfortunately didn’t help. With both methods, the build always fails with > /nix/store/cpydrynvv097qmldsn3wvp44n8ihmqx8-uuids-8cb8720/uuids.nim:2:8 Error: cannot open file: isaac.
Looking at the Nix store, I can see that isaac is building correctly, the same as the other modules. At the beginning of the build, the nix log outputs found nimble input /nix/store/kdh54arssp1cwi5ina26m01k5zp63vg5-isaac-45a5cbb.
I’m pretty unfamiliar with using Nim with NixOS, so if anybody can help I would greatly appreciate it.
nimble2nix use pkgs.nimPackages.buildNimPackage that use nim_builder to interpret the nimble file of dependencies and discover the srcDir (default to project root), but Isaac, with his 180 years old, uses and speaks an archaic nimble format (was somekind of ini).
It means buildNimPackage thinks its content is at . instead of ./src
Options:
fork Isaac, update nimble file, and your nimble2nix.json
override adding replace isaac-0.1.3 to isaac-0.1.3/src in config.nims in postConfigure
ask nimble2nix to accept other arguments like postConfigure in buildNimblePackage
ask @ehmry to make nim_builder, read the older format.
ask @ehmry to make nim_builder read the older format.
I don’t want to support old Nimble formats, I want to support as little of Nimble as possible. Nimble will wither away because we are going to replace it with Nix.
If it were me I would just patch the Nimble file in Isaac or drop in a fresh one.