I’m trying to provision Rust crate into NixOS. I found a way to do this, in NixPkgs documentation(I’m referring to NixOS - Nixpkgs 21.05 manual), so I built my .nix config this way:
But when I’m trying to nixos-rebuild switch, I receive this:
error: infinite recursion encountered, at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:217:28
(use '--show-trace' to show detailed location information)
What is the problem and how to avoid it? As far as I investigated, the main reason of infinite recursion appearance is improper usage of nixpkgs.overlays, but there’s no such thing in my case
It’s not a module, you can’t use it that way, it’s a “package”, and the way it’s written, you need to use callPackage on it and put it to your systemPackages.
Crate build process was successful, but it seems that no binary was produced. Am I again doing something wrong?
I was expecting to see webhookserver binary at /nix/store/hmxq76cj8hdfxzcj9an08q3n37nw0ws2-webhook-server-0.1.4/bin, but there were no such thing
There’s only rg binary in there
As far as I remember the pname has to match the binary name, though that might be missremembering and confusing different language builders and their internals, I sadly can’t test it today anymore, as I’m only on mobile internet and don’t want to download the rust platform
Okay, I was able to look at it. Even though my city is still under “black out”, I went to the office as I have a certification scheduled this evening and I strictly need steady internet for it…
Even though it is still building, I have learned the following so far…
The sha256 passed to fetchFromGitHub matches the sha256 of the ripgrep sources which have already been in my store, therefore no error. Using pkgs.lib.fakeSha256 I was able to determine 0cndr8r5z64rkgvzkjxz3kf40yi7nq42as6hrfcq9ip02a3wazpz as correct. Thats why I like to pass an additional name attribute to fetch* functions.
The rev needs to be v0.1.4
Of course I had to adjust the cargoSha256 as well.
Non local pathes as in the meta.homepage attribute are deprecated as far as I know, you should a string there.