From 0bf71d97bd67ca77f5c3741e155d193476dd3570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Sat, 3 Aug 2024 19:34:10 +0300 Subject: [PATCH] use upstream btrfs-auto-snapshot --- flake.nix | 1 - pkgs/btrfs-auto-snapshot.nix | 75 ------------------------------------ 2 files changed, 76 deletions(-) delete mode 100644 pkgs/btrfs-auto-snapshot.nix diff --git a/flake.nix b/flake.nix index 8f9e4fb..6b1dffa 100644 --- a/flake.nix +++ b/flake.nix @@ -98,7 +98,6 @@ compressDrvWeb = super.callPackage ./pkgs/compress-drv/web.nix { }; tmuxbash = super.callPackage ./pkgs/tmuxbash.nix { }; - btrfs-auto-snapshot = super.callPackage ./pkgs/btrfs-auto-snapshot.nix { }; nicer = super.callPackage ./pkgs/nicer.nix { }; pkgs-unstable = import nixpkgs-unstable { inherit (super) system; }; diff --git a/pkgs/btrfs-auto-snapshot.nix b/pkgs/btrfs-auto-snapshot.nix deleted file mode 100644 index 7392a0c..0000000 --- a/pkgs/btrfs-auto-snapshot.nix +++ /dev/null @@ -1,75 +0,0 @@ -{ - lib, - stdenv, - fetchFromGitHub, - makeWrapper, - coreutils, - getopt, - gnugrep, - gnused, - gawk, - btrfs-progs, - syslogSupport ? true, - util-linux ? null, -}: -assert syslogSupport -> util-linux != null; -stdenv.mkDerivation rec { - version = "2.0.4"; - pname = "btrfs-auto-snapshot"; - - src = fetchFromGitHub { - owner = "hunleyd"; - repo = pname; - rev = "v${version}"; - hash = "sha256-QpuwkGaYAkpu5hYyb360Mr5tHsZc2LzMlKtpS8CyyhI="; - }; - - dontBuild = true; - - nativeBuildInputs = [ makeWrapper ]; - - installPhase = '' - install -Dm755 btrfs-auto-snapshot $out/bin/btrfs-auto-snapshot - ''; - - wrapperPath = - with lib; - makeBinPath ( - [ - coreutils - getopt - gnugrep - gnused - gawk - btrfs-progs - ] - ++ optional syslogSupport util-linux - ); - - postFixup = '' - wrapProgram $out/bin/btrfs-auto-snapshot \ - --prefix PATH : "${wrapperPath}" - ''; - - meta = with lib; { - description = "BTRFS Automatic Snapshot Service for Linux"; - homepage = "https://github.com/hunleyd/btrfs-auto-snapshot"; - license = licenses.gpl2; - mainProgram = "btrfs-auto-snapshot"; - maintainers = with maintainers; [ motiejus ]; - platforms = platforms.linux; - - longDescription = '' - btrfs-auto-snapshot is a Bash script designed to bring as much of the - functionality of the wonderful ZFS snapshot tool zfs-auto-snapshot to - BTRFS as possible. Designed to run from cron (using - /etc/cron.{daily,hourly,weekly}) it automatically creates a snapshot of - the specified BTRFS filesystem (or, optionally, all of them) and then - automatically purges the oldest snapshots of that type (hourly, daily, et - al) based on a user-defined retention policy. - - Snapshots are stored in a '.btrfs' directory at the root of the BTRFS - filesystem being snapped and are read-only by default. - ''; - }; -}