1 { lib, stdenv, fetchurl, writeText, zlib, rpmextract, patchelf, which }:
4 p = if stdenv.hostPlatform.is64bit then {
6 gcclib = "${stdenv.cc.cc.lib}/lib64";
7 sha256 = "sha256-HH/pLZmDr6m/B3e6MHafDGnNWR83oR2y1ijVMR/LOF0=";
8 webarchive = "20220519080155";
12 gcclib = "${stdenv.cc.cc.lib}/lib";
13 sha256 = "sha256-28dmdnJf+qh9r3F0quwlYXB/UqcOzcHzuzFq8vt2bf0=";
14 webarchive = "20220519080430";
17 stdenv.mkDerivation rec {
19 pname = "yandex-disk";
20 version = "0.1.6.1080";
24 "https://repo.yandex.ru/yandex-disk/rpm/stable/${p.arch}/${pname}-${version}-1.fedora.${p.arch}.rpm"
25 "https://web.archive.org/web/${p.webarchive}/https://repo.yandex.ru/yandex-disk/rpm/stable/${p.arch}/${pname}-${version}-1.fedora.${p.arch}.rpm"
30 builder = writeText "builder.sh" ''
38 ${rpmextract}/bin/rpmextract $src
40 mkdir -p $out/share/bash-completion/completions
41 cp -r -t $out/bin usr/bin/*
42 cp -r -t $out/share usr/share/*
43 cp -r -t $out/share/bash-completion/completions etc/bash_completion.d/*
45 sed -i 's@have@${which}/bin/which >/dev/null 2>\&1@' \
46 $out/share/bash-completion/completions/yandex-disk-completion.bash
48 ${patchelf}/bin/patchelf \
49 --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
50 --set-rpath "${zlib.out}/lib:${p.gcclib}" \
55 homepage = "https://help.yandex.com/disk/cli-clients.xml";
56 description = "Free cloud file storage service";
57 maintainers = with lib.maintainers; [ smironov jagajaga ];
58 platforms = ["i686-linux" "x86_64-linux"];
59 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
60 license = lib.licenses.unfree;
62 Yandex.Disk console client for Linux lets you manage files on Disk without
63 using a window interface or programs that support WebDAV. The advantages
64 of the console client compared to a WebDAV connection:
65 * low system resource requirements;
66 * faster file reading and writing speeds;
67 * faster syncing with Disk's server;
68 * no need to be constantly connected to work with files.
70 mainProgram = "yandex-disk";