15 assert syslogSupport -> util-linux != null;
16 stdenv.mkDerivation rec {
18 pname = "btrfs-auto-snapshot";
20 src = fetchFromGitHub {
24 hash = "sha256-QpuwkGaYAkpu5hYyb360Mr5tHsZc2LzMlKtpS8CyyhI=";
29 nativeBuildInputs = [ makeWrapper ];
32 install -Dm755 btrfs-auto-snapshot $out/bin/btrfs-auto-snapshot
35 wrapperPath = lib.makeBinPath (
44 ++ lib.optional syslogSupport util-linux
48 wrapProgram $out/bin/btrfs-auto-snapshot \
49 --prefix PATH : "${wrapperPath}"
53 description = "BTRFS Automatic Snapshot Service for Linux";
54 homepage = "https://github.com/hunleyd/btrfs-auto-snapshot";
55 license = licenses.gpl2;
56 mainProgram = "btrfs-auto-snapshot";
57 maintainers = with maintainers; [ motiejus ];
58 platforms = platforms.linux;
61 btrfs-auto-snapshot is a Bash script designed to bring as much of the
62 functionality of the wonderful ZFS snapshot tool zfs-auto-snapshot to
63 BTRFS as possible. Designed to run from cron (using
64 /etc/cron.{daily,hourly,weekly}) it automatically creates a snapshot of
65 the specified BTRFS filesystem (or, optionally, all of them) and then
66 automatically purges the oldest snapshots of that type (hourly, daily, et
67 al) based on a user-defined retention policy.
69 Snapshots are stored in a '.btrfs' directory at the root of the BTRFS
70 filesystem being snapped and are read-only by default.