1: # Check whether the given package provides the given binary 2: { die, runCommand }: 3: 4: pkg: bin: 5: assert builtins.isString bin || die { 6: inherit bin pkg; 7: error = "bin must be a string"; 8: }; 9: runCommand "have-binary-${bin}" { 10: inherit bin; 11: buildInputs = [ pkg ]; 12: } '' 13: command -v "$bin" || exit 1 14: echo pass > "$out" 15: ''