about summary refs log tree commit diff
path: root/pkgs/applications/backup/timeshift/unwrapped.nix
diff options
context:
space:
mode:
authorShamrock Lee <44064051+ShamrockLee@users.noreply.github.com>2020-12-06 04:53:05 +0000
committerShamrock Lee <44064051+ShamrockLee@users.noreply.github.com>2022-06-07 22:28:24 +0800
commitc7cb6f953936d06ff34a9ce12aa3cfba42edc242 (patch)
treeb238bcf5853441543df9ecd47da33d02205a983f /pkgs/applications/backup/timeshift/unwrapped.nix
parent6042a2221e782a51ce2d4b38106e99cbf3b6c937 (diff)
timeshift: init at 22.06.1
Diffstat (limited to 'pkgs/applications/backup/timeshift/unwrapped.nix')
-rw-r--r--pkgs/applications/backup/timeshift/unwrapped.nix77
1 files changed, 77 insertions, 0 deletions
diff --git a/pkgs/applications/backup/timeshift/unwrapped.nix b/pkgs/applications/backup/timeshift/unwrapped.nix
new file mode 100644
index 0000000000000..1f34491dafdce
--- /dev/null
+++ b/pkgs/applications/backup/timeshift/unwrapped.nix
@@ -0,0 +1,77 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, gettext
+, pkg-config
+, vala
+, which
+, gtk3
+, json-glib
+, libgee
+, utillinux
+, vte
+, xapps
+}:
+
+stdenv.mkDerivation rec {
+  pname = "timeshift";
+  version = "22.06.1";
+
+  src = fetchFromGitHub {
+    owner = "linuxmint";
+    repo = "timeshift";
+    rev = "v${version}";
+    sha256 = "XcxwVBKMv2YwbrI3FFWDQFs8hHruhkZq3YqzkptE6KE=";
+  };
+
+  patches = [
+    ./timeshift-launcher.patch
+  ];
+
+  postPatch = ''
+    while IFS="" read -r -d $'\0' FILE; do
+      substituteInPlace "$FILE" \
+        --replace "/sbin/blkid" "${utillinux}/bin/blkid"
+    done < <(find ./src -mindepth 1 -name "*.vala" -type f -print0)
+    substituteInPlace ./src/Utility/IconManager.vala \
+      --replace "/usr/share" "$out/share"
+    substituteInPlace ./src/Core/Main.vala \
+      --replace "/etc/timeshift/default.json" "$out/etc/timeshift/default.json" \
+      --replace "file_copy(app_conf_path_default, app_conf_path);" "if (!dir_exists(file_parent(app_conf_path))){dir_create(file_parent(app_conf_path));};file_copy(app_conf_path_default, app_conf_path);"
+  '';
+
+  nativeBuildInputs = [
+    gettext
+    pkg-config
+    vala
+    which
+  ];
+
+  buildInputs = [
+    gtk3
+    json-glib
+    libgee
+    vte
+    xapps
+  ];
+
+  preBuild = ''
+    makeFlagsArray+=( \
+      "-C" "src" \
+      "prefix=$out" \
+      "sysconfdir=$out/etc" \
+    )
+  '';
+
+  meta = with lib; {
+    description = "A system restore tool for Linux";
+    longDescription = ''
+      TimeShift creates filesystem snapshots using rsync+hardlinks or BTRFS snapshots.
+      Snapshots can be restored using TimeShift installed on the system or from Live CD or USB.
+    '';
+    homepage = "https://github.com/linuxmint/timeshift";
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ ShamrockLee ];
+  };
+}