1{ lib, stdenv, fetchzip, mono, sqlite, makeWrapper }:
2
3stdenv.mkDerivation rec {
4 pname = "duplicati";
5 version = "2.0.6.3";
6 channel = "beta";
7 build_date = "2021-06-17";
8
9 src = fetchzip {
10 url = "https://github.com/duplicati/duplicati/releases/download/v${version}-${version}_${channel}_${build_date}/duplicati-${version}_${channel}_${build_date}.zip";
11 sha256 = "sha256-usMwlmer6rLgP46wGVkaAIocUW4MjuEpVWdX7rRcghg=";
12 stripRoot = false;
13 };
14
15 nativeBuildInputs = [ makeWrapper ];
16
17 installPhase = ''
18 mkdir -p $out/{bin,share/${pname}-${version}}
19 cp -r * $out/share/${pname}-${version}
20 makeWrapper "${mono}/bin/mono" $out/bin/duplicati-cli \
21 --add-flags "$out/share/${pname}-${version}/Duplicati.CommandLine.exe" \
22 --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [
23 sqlite ]}
24 makeWrapper "${mono}/bin/mono" $out/bin/duplicati-server \
25 --add-flags "$out/share/${pname}-${version}/Duplicati.Server.exe" \
26 --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [
27 sqlite ]}
28 '';
29
30 meta = with lib; {
31 description = "A free backup client that securely stores encrypted, incremental, compressed backups on cloud storage services and remote file servers";
32 homepage = "https://www.duplicati.com/";
33 license = licenses.lgpl21;
34 maintainers = with maintainers; [ nyanloutre ];
35 platforms = platforms.all;
36 };
37}