depot/third_party/nixpkgs/pkgs/applications/backup/timeshift/unwrapped.nix
Luke Granger-Brown f92e137cfb
Some checks failed
/ combine-systems (push) Blocked by required conditions
/ build (x86_64-linux) (push) Failing after 11m44s
/ build (aarch64-linux) (push) Failing after 11m50s
/ build (push) Failing after 16m42s
Merge commit '1e2ed035f4bebc9adad02b365508ad96f7df87c1' into HEAD
2025-03-02 02:23:32 +00:00

81 lines
2 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
gettext,
help2man,
meson,
ninja,
pkg-config,
vala,
gtk3,
json-glib,
libgee,
util-linux,
vte,
xapp,
}:
stdenv.mkDerivation rec {
pname = "timeshift";
version = "24.06.6";
src = fetchFromGitHub {
owner = "linuxmint";
repo = "timeshift";
rev = version;
hash = "sha256-umMekxP9bvV01KzfIh2Zxa9Xb+tR5x+tG9dOnBIOkjY=";
};
postPatch = ''
for FILE in src/Core/Main.vala src/Utility/Device.vala; do
substituteInPlace "$FILE" \
--replace-fail "/sbin/blkid" "${lib.getExe' util-linux "blkid"}"
done
substituteInPlace ./src/Utility/IconManager.vala \
--replace-fail "/usr/share" "$out/share"
# Substitute app_command to look for the `timeshift-gtk` in $out.
# Substitute the `pkexec ...` as a hack to run a GUI application like Timeshift as root without setting up the corresponding pkexec policy.
substituteInPlace ./src/timeshift-launcher \
--replace-fail "app_command='timeshift-gtk'" "app_command=$out/bin/timeshift-gtk" \
--replace-fail ${lib.escapeShellArg ''pkexec ''${app_command}''} ${lib.escapeShellArg ''pkexec env DISPLAY="$DISPLAY" XAUTHORITY="$XAUTHORITY" "''${app_command}"''}
'';
nativeBuildInputs = [
gettext
help2man
meson
ninja
pkg-config
vala
];
buildInputs = [
gtk3
json-glib
libgee
vte
xapp
];
env = lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
};
meta = with lib; {
description = "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.gpl2Plus;
platforms = platforms.linux;
maintainers = with maintainers; [
ShamrockLee
bobby285271
];
};
}