To check whether an override of build inputs and derivation arguments might solve the problem:
git clone --depth=1 https://github.com/nixos/nixpkgs
Edit
~/repos/nixpkgs/pkgs/development/r-modules/generic-builder
such that these two lines
{ stdenv, lib, R, libcxx, xvfb-run, util-linux, Cocoa, Foundation, gettext, gfortran }
...
buildInputs = buildInputs ++ [R gettext] ++
become
{ stdenv, lib, R, libcxx, xvfb-run, util-linux, Cocoa, Foundation, gettext, gfortran, cargo, rustc }
...
buildInputs = buildInputs ++ [R gettext] ++ [cargo rustc] ++
Now the builder steps:
mkdir -p tmpdev && cd tmpdev
nix-shell $HOME/repos/nixpkgs -A rPackages.gifski
export out=out
genericBuild
run successfully.
So far, so good. However, trying:
nix-shell -p rPackages.gifski -I nixpkgs=$HOME/repos/nixpkgs
… fails with
...
Updating crates.io index
warning: spurious network error (2 tries remaining): [6] Couldn't resolve host name (Could not resolve host: github.com); class=Net (12)
warning: spurious network error (1 tries remaining): [6] Couldn't resolve host name (Could not resolve host: github.com); class=Net (12)
error: Unable to update registry `crates-io`
Caused by:
failed to fetch `https://github.com/rust-lang/crates.io-index`
Caused by:
network failure seems to have happened
if a proxy or similar is necessary `net.git-fetch-with-cli` may help here
https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli
Caused by:
[6] Couldn't resolve host name (Could not resolve host: github.com); class=Net (12)
make: *** [Makevars:13: myrustlib/target/release/libmyrustlib.a] Error 101
ERROR: compilation failed for package 'gifski'
* removing '/nix/store/n0j4yf4snq699g4mffkpwsx5lnqmg0vb-r-gifski-1.6.6-1/library/gifski'
error: builder for '/nix/store/jzj8jxkgk7wi1nic001sn8aff7wz51jk-r-gifski-1.6.6-1.drv' failed with exit code 1;
last 10 log lines:
> Caused by:
> network failure seems to have happened
> if a proxy or similar is necessary `net.git-fetch-with-cli` may help here
> https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli
>
> Caused by:
> [6] Couldn't resolve host name (Could not resolve host: github.com); class=Net (12)
> make: *** [Makevars:13: myrustlib/target/release/libmyrustlib.a] Error 101
> ERROR: compilation failed for package 'gifski'
> * removing '/nix/store/n0j4yf4snq699g4mffkpwsx5lnqmg0vb-r-gifski-1.6.6-1/library/gifski'
For full logs, run 'nix log /nix/store/jzj8jxkgk7wi1nic001sn8aff7wz51jk-r-gifski-1.6.6-1.drv'.
I am not sure what to do now. Any suggestions welcome.