1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5 makeWrapper,
6 gettext,
7 python3,
8 rsync,
9 cron,
10 openssh,
11 sshfs-fuse,
12 encfs,
13}:
14
15let
16 python' = python3.withPackages (
17 ps: with ps; [
18 dbus-python
19 keyring
20 packaging
21 ]
22 );
23
24 apps = lib.makeBinPath [
25 openssh
26 python'
27 cron
28 rsync
29 sshfs-fuse
30 encfs
31 ];
32in
33stdenv.mkDerivation rec {
34 pname = "backintime-common";
35 version = "1.5.5";
36
37 src = fetchFromGitHub {
38 owner = "bit-team";
39 repo = "backintime";
40 rev = "v${version}";
41 sha256 = "sha256-Xrls+FE41bcx0S/mO4z5Mm97+P5fmIJDSkS3puKmdig=";
42 };
43
44 nativeBuildInputs = [
45 makeWrapper
46 gettext
47 ];
48 buildInputs = [ python' ];
49
50 installFlags = [ "DEST=$(out)" ];
51
52 configureFlags = [ "--python=${lib.getExe python'}" ];
53
54 preConfigure = ''
55 patchShebangs --build updateversion.sh
56 cd common
57 substituteInPlace configure \
58 --replace-fail "/.." "" \
59 --replace-fail "share/backintime" "${python'.sitePackages}/backintime"
60 substituteInPlace "backintime" "backintime-askpass" \
61 --replace-fail "share" "${python'.sitePackages}"
62 '';
63
64 dontAddPrefix = true;
65
66 preFixup = ''
67 wrapProgram "$out/bin/backintime" \
68 --prefix PATH : ${apps}
69 '';
70
71 meta = {
72 homepage = "https://github.com/bit-team/backintime";
73 description = "Simple backup tool for Linux";
74 license = lib.licenses.gpl2;
75 maintainers = with lib.maintainers; [ stephen-huan ];
76 platforms = lib.platforms.linux;
77 mainProgram = "backintime";
78 longDescription = ''
79 Back In Time is a simple backup tool (on top of rsync) for Linux
80 inspired from "flyback project" and "TimeVault". The backup is
81 done by taking snapshots of a specified set of directories.
82 '';
83 };
84}