1 { lib, stdenv, buildGoModule, fetchFromGitHub, buildPackages, installShellFiles
3 , enableCmount ? true, fuse, macfuse-stubs
11 src = fetchFromGitHub {
15 hash = "sha256-gOFOcqCgFAiTc6W3v8Z917hGCzxluswqnuOoUht73GA=";
18 vendorHash = "sha256-eYIGVCTvUfGbsIMFthEfD0r6aeA7Ly9xJ8PJ6hR2SjA=";
20 subPackages = [ "." ];
22 outputs = [ "out" "man" ];
24 buildInputs = lib.optional enableCmount (if stdenv.isDarwin then macfuse-stubs else fuse);
25 nativeBuildInputs = [ installShellFiles makeWrapper ];
27 tags = lib.optionals enableCmount [ "cmount" ];
29 ldflags = [ "-s" "-w" "-X github.com/rclone/rclone/fs.Version=${version}" ];
34 if stdenv.buildPlatform.canExecute stdenv.hostPlatform
36 else lib.getBin buildPackages.rclone;
39 installManPage rclone.1
40 for shell in bash zsh fish; do
41 ${rcloneBin}/bin/rclone genautocomplete $shell rclone.$shell
42 installShellCompletion rclone.$shell
46 ln -s $out/bin/rclone $out/bin/rclonefs
47 ln -s $out/bin/rclone $out/bin/mount.rclone
48 '' + lib.optionalString (enableCmount && !stdenv.isDarwin)
49 # use --suffix here to ensure we don't shadow /run/wrappers/bin/fusermount,
50 # as the setuid wrapper is required as non-root on NixOS.
52 wrapProgram $out/bin/rclone \
53 --suffix PATH : "${lib.makeBinPath [ fuse ] }" \
54 --prefix LD_LIBRARY_PATH : "${fuse}/lib"
62 description = "Command line program to sync files and directories to and from major cloud storage";
63 homepage = "https://rclone.org";
64 changelog = "https://github.com/rclone/rclone/blob/v${version}/docs/content/changelog.md";
65 license = licenses.mit;
66 mainProgram = "rclone";
67 maintainers = with maintainers; [ marsam SuperSandro2000 ];