For practice, I’m trying to package a very simple bash script with two dependencies (https://github.com/fcambus/ansiweather/blob/ed4e421e76effe7e6c64eb89ad4e46a043e5dbd7/ansiweather). It depends runtime on jq and bc, so these need to go in buildInputs
. Unfortunately, when I build the package and run the result, the script cannot see jq or bc. I’m building the derivation by adding it to nixpkgs via an overlay, and then running nix-build '<nixpkgs>' -A ansiweather
. Then running ./result/bin/ansiweather
results in ERROR: Cannot find jq binary
. Can someone point out where the error is? Below is my derivation:
{ stdenv, fetchFromGitHub, jq, bc }:
stdenv.mkDerivation rec {
pname = "ansiweather";
version = "1.15.0";
src = fetchFromGitHub {
owner = "fcambus";
repo = "ansiweather";
rev = version;
sha256 = "148x881xjhw2ws1xs3m0xb30xv1s1q3bn40j0knl3z3sav75qzz7";
};
buildInputs = [
jq
bc
];
installPhase = ''
mkdir -p $out/bin
cp ansiweather $out/bin/
'';
}