diff options
Diffstat (limited to 'nixpkgs/pkgs/tools/backup')
99 files changed, 5018 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/backup/android-backup-extractor/default.nix b/nixpkgs/pkgs/tools/backup/android-backup-extractor/default.nix new file mode 100644 index 000000000000..5411b70c77a2 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/android-backup-extractor/default.nix @@ -0,0 +1,39 @@ +{ stdenv +, lib +, fetchurl +, makeWrapper +, jre +}: + +stdenv.mkDerivation rec { + pname = "android-backup-extractor"; + version = "20210909062443-4c55371"; + + src = fetchurl { + url = "https://github.com/nelenkov/android-backup-extractor/releases/download/${version}/abe.jar"; + sha256 = "0ms241kb4h9y9apr637sb4kw5mml40c1ac0q4jcxhnwr3dr05w1q"; + }; + + dontUnpack = true; + dontConfigure = true; + dontBuild = true; + + nativeBuildInputs = [ makeWrapper ]; + + buildInputs = [ jre ]; + + installPhase = '' + runHook preInstall + install -D $src $out/lib/android-backup-extractor/abe.jar + makeWrapper ${jre}/bin/java $out/bin/abe --add-flags "-cp $out/lib/android-backup-extractor/abe.jar org.nick.abe.Main" + runHook postInstall + ''; + + meta = with lib; { + description = "Utility to extract and repack Android backups created with adb backup"; + homepage = "https://github.com/nelenkov/android-backup-extractor"; + sourceProvenance = with sourceTypes; [ binaryBytecode ]; + license = licenses.asl20; + maintainers = with maintainers; [ prusnak ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/automysqlbackup/default.nix b/nixpkgs/pkgs/tools/backup/automysqlbackup/default.nix new file mode 100644 index 000000000000..f103149a83d7 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/automysqlbackup/default.nix @@ -0,0 +1,32 @@ +{ lib, stdenv, fetchFromGitHub, makeWrapper, mariadb, mailutils, pbzip2, pigz, bzip2, gzip }: + +stdenv.mkDerivation rec { + pname = "automysqlbackup"; + version = "3.0.7"; + + src = fetchFromGitHub { + owner = "sixhop"; + repo = pname; + rev = version; + sha256 = "sha256-C0p1AY4yIxybQ6a/HsE3ZTHumtvQw5kKM51Ap+Se0ZI="; + }; + + nativeBuildInputs = [ makeWrapper ]; + + installPhase = '' + mkdir -p $out/bin $out/etc + + cp automysqlbackup $out/bin/ + cp automysqlbackup.conf $out/etc/ + + wrapProgram $out/bin/automysqlbackup --prefix PATH : ${lib.makeBinPath [ mariadb mailutils pbzip2 pigz bzip2 gzip ]} + ''; + + meta = with lib; { + description = "A script to run daily, weekly and monthly backups for your MySQL database"; + homepage = "https://github.com/sixhop/AutoMySQLBackup"; + platforms = platforms.linux; + maintainers = [ maintainers.aanderse ]; + license = licenses.gpl2Plus; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/autorestic/default.nix b/nixpkgs/pkgs/tools/backup/autorestic/default.nix new file mode 100644 index 000000000000..bf3d6d326073 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/autorestic/default.nix @@ -0,0 +1,32 @@ +{ lib, fetchFromGitHub, installShellFiles, buildGoModule }: + +buildGoModule rec { + pname = "autorestic"; + version = "1.7.11"; + + src = fetchFromGitHub { + owner = "cupcakearmy"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-Uewr9WP+HtVdWnH26+zoQjTuzE7TyNR9WlYvK2kRHaU="; + }; + + vendorHash = "sha256-K3+5DRXcx56sJ4XHikVtmoxmpJbBeAgPkN9KtHVgvYA="; + + nativeBuildInputs = [ installShellFiles ]; + + postInstall = '' + installShellCompletion --cmd autorestic \ + --bash <($out/bin/autorestic completion bash) \ + --fish <($out/bin/autorestic completion fish) \ + --zsh <($out/bin/autorestic completion zsh) + ''; + + meta = with lib; { + description = "High level CLI utility for restic"; + homepage = "https://github.com/cupcakearmy/autorestic"; + license = licenses.asl20; + maintainers = with maintainers; [ renesat ]; + mainProgram = "autorestic"; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/awsbck/default.nix b/nixpkgs/pkgs/tools/backup/awsbck/default.nix new file mode 100644 index 000000000000..cb5b4f76549c --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/awsbck/default.nix @@ -0,0 +1,33 @@ +{ lib +, stdenv +, fetchFromGitHub +, rustPlatform +, Security +}: + +rustPlatform.buildRustPackage rec { + pname = "awsbck"; + version = "0.3.7"; + + src = fetchFromGitHub { + owner = "beeb"; + repo = "awsbck"; + rev = "v${version}"; + hash = "sha256-asYXmBPNsIac+c/UXSijol+DFI7qZVpg/SKxaadlBOI="; + }; + + cargoHash = "sha256-vFIBl/ZvSZn/9yLYMtzFvlPM+OYkZndkT6qPCIWVlOM="; + + buildInputs = lib.optionals stdenv.isDarwin [ Security ]; + + # tests run in CI on the source repo + doCheck = false; + + meta = with lib; { + description = "Backup a folder to AWS S3, once or periodically"; + homepage = "https://github.com/beeb/awsbck"; + license = with licenses; [ mit asl20 ]; + maintainers = with maintainers; [ beeb ]; + mainProgram = "awsbck"; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/bacula/default.nix b/nixpkgs/pkgs/tools/backup/bacula/default.nix new file mode 100644 index 000000000000..c75312606550 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/bacula/default.nix @@ -0,0 +1,53 @@ +{ lib, stdenv, fetchurl, sqlite, postgresql, zlib, acl, ncurses, openssl, readline +, CoreFoundation, IOKit +}: + +stdenv.mkDerivation rec { + pname = "bacula"; + version = "13.0.4"; + + src = fetchurl { + url = "mirror://sourceforge/bacula/${pname}-${version}.tar.gz"; + sha256 = "sha256-FOTGLTgaEAhCLj/RSq0ZsmFBA9iQeJJtczf4UOO0c9w="; + }; + + # libtool.m4 only matches macOS 10.* + postPatch = lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) '' + substituteInPlace configure \ + --replace "10.*)" "*)" + ''; + + buildInputs = [ postgresql sqlite zlib ncurses openssl readline ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + CoreFoundation + IOKit + ] + # acl relies on attr, which I can't get to build on darwin + ++ lib.optional (!stdenv.isDarwin) acl; + + configureFlags = [ + "--with-sqlite3=${sqlite.dev}" + "--with-postgresql=${postgresql}" + "--with-logdir=/var/log/bacula" + "--with-working-dir=/var/lib/bacula" + "--mandir=\${out}/share/man" + ] ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "ac_cv_func_setpgrp_void=yes"; + + installFlags = [ + "logdir=\${out}/logdir" + "working_dir=\${out}/workdir" + ]; + + postInstall = '' + mkdir -p $out/bin + ln -s $out/sbin/* $out/bin + ''; + + meta = with lib; { + description = "Enterprise ready, Network Backup Tool"; + homepage = "http://bacula.org/"; + license = with licenses; [ agpl3Only bsd2 ]; + maintainers = with maintainers; [ lovek323 eleanor ]; + platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/bakelite/default.nix b/nixpkgs/pkgs/tools/backup/bakelite/default.nix new file mode 100644 index 000000000000..c67741b06869 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/bakelite/default.nix @@ -0,0 +1,34 @@ +{ lib, stdenv, fetchFromGitHub }: + +stdenv.mkDerivation rec { + pname = "bakelite"; + version = "unstable-2022-02-12"; + + src = fetchFromGitHub { + owner = "richfelker"; + repo = pname; + rev = "373901734d114e42aa385e6a7843745674e4ca08"; + hash = "sha256-HBnYlUyTkvPTbdsZD02yCq5C7yXOHYK4l4mDRUkcN5I="; + }; + + hardeningEnable = [ "pie" ]; + preBuild = '' + # pipe2() is only exposed with _GNU_SOURCE + # Upstream makefile explicitly uses -O3 to improve SHA-3 performance + makeFlagsArray+=( CFLAGS="-D_GNU_SOURCE -g -O3" ) + ''; + + installPhase = '' + mkdir -p $out/bin + cp bakelite $out/bin + ''; + + meta = with lib; { + homepage = "https://github.com/richfelker/bakelite"; + description = "Incremental backup with strong cryptographic confidentality"; + license = licenses.gpl2; + maintainers = with maintainers; [ mvs ]; + # no support for Darwin (yet: https://github.com/richfelker/bakelite/pull/5) + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/bdsync/default.nix b/nixpkgs/pkgs/tools/backup/bdsync/default.nix new file mode 100644 index 000000000000..8018a1b7cfdf --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/bdsync/default.nix @@ -0,0 +1,41 @@ +{ lib, stdenv, fetchFromGitHub +, openssl +, pandoc +, which +}: + +stdenv.mkDerivation rec { + pname = "bdsync"; + version = "0.11.3"; + + src = fetchFromGitHub { + owner = "rolffokkens"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-58yoF6s0WjH+1mTY7X5OX53YgcnDmGxoCR8Kvl6lP+A="; + }; + + nativeBuildInputs = [ pandoc which ]; + buildInputs = [ openssl ]; + + postPatch = '' + patchShebangs ./tests.sh + patchShebangs ./tests/ + ''; + + doCheck = true; + + installPhase = '' + install -Dm755 bdsync -t $out/bin/ + install -Dm644 bdsync.1 -t $out/share/man/man1/ + ''; + + meta = with lib; { + description = "Fast block device synchronizing tool"; + homepage = "https://github.com/rolffokkens/bdsync"; + license = licenses.gpl2; + platforms = platforms.linux; + maintainers = with maintainers; [ jluttine ]; + mainProgram = "bdsync"; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/borgbackup/default.nix b/nixpkgs/pkgs/tools/backup/borgbackup/default.nix new file mode 100644 index 000000000000..d7853d0506f6 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/borgbackup/default.nix @@ -0,0 +1,141 @@ +{ lib +, stdenv +, acl +, e2fsprogs +, libb2 +, lz4 +, openssh +, openssl +, python3Packages +, xxHash +, zstd +, installShellFiles +, nixosTests +, fetchPypi +}: + +let + python = python3Packages.python.override { + packageOverrides = self: super: { + msgpack = super.msgpack.overrideAttrs (oldAttrs: rec { + version ="1.0.4"; + + src = fetchPypi { + pname = "msgpack"; + inherit version; + hash = "sha256-9dhpwY8DAgLrQS8Iso0q/upVPWYTruieIA16yn7wH18="; + }; + }); + }; + }; +in +python.pkgs.buildPythonApplication rec { + pname = "borgbackup"; + version = "1.2.7"; + format = "pyproject"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-9j8oozg8BBlxzsh7BhyjmoFbX9RF2ySqgXLKxBfZQRo="; + }; + + postPatch = '' + # sandbox does not support setuid/setgid/sticky bits + substituteInPlace src/borg/testsuite/archiver.py \ + --replace "0o4755" "0o0755" + ''; + + nativeBuildInputs = with python.pkgs; [ + cython + setuptools-scm + pkgconfig + + # docs + sphinxHook + guzzle-sphinx-theme + + # shell completions + installShellFiles + ]; + + sphinxBuilders = [ "singlehtml" "man" ]; + + buildInputs = [ + libb2 + lz4 + xxHash + zstd + openssl + ] ++ lib.optionals stdenv.isLinux [ + acl + ]; + + propagatedBuildInputs = with python.pkgs; [ + msgpack + packaging + (if stdenv.isLinux then pyfuse3 else llfuse) + ]; + + makeWrapperArgs = [ + ''--prefix PATH ':' "${openssh}/bin"'' + ]; + + postInstall = '' + installShellCompletion --cmd borg \ + --bash scripts/shell_completions/bash/borg \ + --fish scripts/shell_completions/fish/borg.fish \ + --zsh scripts/shell_completions/zsh/_borg + ''; + + nativeCheckInputs = with python.pkgs; [ + e2fsprogs + py + python-dateutil + pytest-benchmark + pytest-xdist + pytestCheckHook + ]; + + pytestFlagsArray = [ + "--benchmark-skip" + "--pyargs" "borg.testsuite" + ]; + + disabledTests = [ + # fuse: device not found, try 'modprobe fuse' first + "test_fuse" + "test_fuse_allow_damaged_files" + "test_fuse_mount_hardlinks" + "test_fuse_mount_options" + "test_fuse_versions_view" + "test_migrate_lock_alive" + "test_readonly_mount" + # Error: Permission denied while trying to write to /var/{,tmp} + "test_get_cache_dir" + "test_get_keys_dir" + "test_get_security_dir" + "test_get_config_dir" + # https://github.com/borgbackup/borg/issues/6573 + "test_basic_functionality" + ]; + + preCheck = '' + export HOME=$TEMP + ''; + + passthru.tests = { + inherit (nixosTests) borgbackup; + }; + + outputs = [ "out" "doc" "man" ]; + + meta = with lib; { + changelog = "https://github.com/borgbackup/borg/blob/${version}/docs/changes.rst"; + description = "Deduplicating archiver with compression and encryption"; + homepage = "https://www.borgbackup.org"; + license = licenses.bsd3; + platforms = platforms.unix; # Darwin and FreeBSD mentioned on homepage + mainProgram = "borg"; + maintainers = with maintainers; [ dotlambda globin ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/borgmatic/default.nix b/nixpkgs/pkgs/tools/backup/borgmatic/default.nix new file mode 100644 index 000000000000..2b3b9e92f90c --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/borgmatic/default.nix @@ -0,0 +1,73 @@ +{ lib +, stdenv +, borgbackup +, coreutils +, python3Packages +, fetchPypi +, systemd +, enableSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd +, installShellFiles +, borgmatic +, testers +}: + +python3Packages.buildPythonApplication rec { + pname = "borgmatic"; + version = "1.8.8"; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-dPWp8SH4//HJlCrF6YRaMb32idox1E0/Gd8qc/GmP4c="; + }; + + nativeCheckInputs = with python3Packages; [ flexmock pytestCheckHook pytest-cov ] ++ passthru.optional-dependencies.apprise; + + # - test_borgmatic_version_matches_news_version + # The file NEWS not available on the pypi source, and this test is useless + disabledTests = [ + "test_borgmatic_version_matches_news_version" + ]; + + nativeBuildInputs = [ installShellFiles ]; + + propagatedBuildInputs = with python3Packages; [ + borgbackup + colorama + jsonschema + packaging + ruamel-yaml + requests + setuptools + ]; + + passthru.optional-dependencies = { + apprise = with python3Packages; [ apprise ]; + }; + + postInstall = '' + installShellCompletion --cmd borgmatic \ + --bash <($out/bin/borgmatic --bash-completion) + '' + lib.optionalString enableSystemd '' + mkdir -p $out/lib/systemd/system + cp sample/systemd/borgmatic.timer $out/lib/systemd/system/ + # there is another "sleep", so choose the one with the space after it + # due to https://github.com/borgmatic-collective/borgmatic/commit/2e9f70d49647d47fb4ca05f428c592b0e4319544 + substitute sample/systemd/borgmatic.service \ + $out/lib/systemd/system/borgmatic.service \ + --replace /root/.local/bin/borgmatic $out/bin/borgmatic \ + --replace systemd-inhibit ${systemd}/bin/systemd-inhibit \ + --replace "sleep " "${coreutils}/bin/sleep " + ''; + + passthru.tests.version = testers.testVersion { package = borgmatic; }; + + __darwinAllowLocalNetworking = true; + + meta = with lib; { + description = "Simple, configuration-driven backup software for servers and workstations"; + homepage = "https://torsion.org/borgmatic/"; + license = licenses.gpl3Plus; + platforms = platforms.all; + maintainers = with maintainers; [ imlonghao ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/btar/default.nix b/nixpkgs/pkgs/tools/backup/btar/default.nix new file mode 100644 index 000000000000..f1033d275aab --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/btar/default.nix @@ -0,0 +1,36 @@ +{ lib, stdenv, fetchurl, fetchpatch, librsync }: + +stdenv.mkDerivation rec { + pname = "btar"; + version = "1.1.1"; + + src = fetchurl { + url = "https://vicerveza.homeunix.net/~viric/soft/btar/btar-${version}.tar.gz"; + sha256 = "0miklk4bqblpyzh1bni4x6lqn88fa8fjn15x1k1n8bxkx60nlymd"; + }; + + patches = [ + (fetchpatch { + url = "https://build.opensuse.org/public/source/openSUSE:Factory/btar/btar-librsync.patch?rev=2"; + sha256 = "1awqny9489vsfffav19s73xxg26m7zrhvsgf1wxb8c2izazwr785"; + }) + ]; + + # Workaround build failure on -fno-common toolchains like upstream + # gcc-10. Otherwise build fails as: + # ld: listindex.o:/build/btar-1.1.1/loadindex.h:12: multiple definition of + # `ptr'; main.o:/build/btar-1.1.1/loadindex.h:12: first defined here + env.NIX_CFLAGS_COMPILE = "-fcommon"; + + buildInputs = [ librsync ]; + + makeFlags = [ "PREFIX=$(out)" ]; + + meta = with lib; { + description = "Tar-compatible block-based archiver"; + license = lib.licenses.gpl3Plus; + homepage = "https://viric.name/cgi-bin/btar"; + platforms = platforms.all; + maintainers = with maintainers; [ viric ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/btrbk/default.nix b/nixpkgs/pkgs/tools/backup/btrbk/default.nix new file mode 100644 index 000000000000..36bd2065de7e --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/btrbk/default.nix @@ -0,0 +1,73 @@ +{ lib +, stdenv +, fetchurl +, bash +, btrfs-progs +, openssh +, perl +, perlPackages +, util-linux +, asciidoctor +, mbuffer +, makeWrapper +, genericUpdater +, curl +, writeShellScript +, nixosTests +}: + +stdenv.mkDerivation rec { + pname = "btrbk"; + version = "0.32.6"; + + src = fetchurl { + url = "https://digint.ch/download/btrbk/releases/${pname}-${version}.tar.xz"; + sha256 = "AuKsZHyRhGMgLL5ge7lVV6T3/SNwaRJDM8VNpbK7t2s="; + }; + + nativeBuildInputs = [ asciidoctor makeWrapper ]; + + buildInputs = with perlPackages; [ perl DateCalc ]; + + preInstall = '' + for f in $(find . -name Makefile); do + substituteInPlace "$f" \ + --replace "/usr" "$out" \ + --replace "/etc" "$out/etc" + done + + # Tainted Mode disables PERL5LIB + substituteInPlace btrbk \ + --replace "perl -T" "perl" \ + --replace "\$0" "\$ENV{'program_name'}" + + # Fix SSH filter script + sed -i '/^export PATH/d' ssh_filter_btrbk.sh + substituteInPlace ssh_filter_btrbk.sh --replace logger ${util-linux}/bin/logger + ''; + + preFixup = '' + wrapProgram $out/bin/btrbk \ + --set PERL5LIB $PERL5LIB \ + --run 'export program_name=$0' \ + --prefix PATH ':' "${lib.makeBinPath [ btrfs-progs bash mbuffer openssh ]}" + ''; + + passthru.tests = { + inherit (nixosTests) btrbk btrbk-no-timer btrbk-section-order btrbk-doas; + }; + + passthru.updateScript = genericUpdater { + versionLister = writeShellScript "btrbk-versionLister" '' + ${curl}/bin/curl -s https://digint.ch/download/btrbk/releases/ | ${perl}/bin/perl -lne 'print $1 if /btrbk-([0-9.]*)\.tar/' + ''; + }; + + meta = with lib; { + description = "A backup tool for btrfs subvolumes"; + homepage = "https://digint.ch/btrbk"; + license = licenses.gpl3Only; + platforms = platforms.unix; + maintainers = with maintainers; [ asymmetric ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/bup/default.nix b/nixpkgs/pkgs/tools/backup/bup/default.nix new file mode 100644 index 000000000000..c2b7b048bce2 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/bup/default.nix @@ -0,0 +1,61 @@ +{ lib, stdenv, fetchFromGitHub, makeWrapper +, perl, pandoc, python3, git +, par2cmdline ? null, par2Support ? true +}: + +assert par2Support -> par2cmdline != null; + +let + version = "0.33.3"; + + pythonDeps = with python3.pkgs; [ setuptools tornado ] + ++ lib.optionals (!stdenv.isDarwin) [ pyxattr pylibacl fuse ]; +in + +stdenv.mkDerivation { + pname = "bup"; + inherit version; + + src = fetchFromGitHub { + repo = "bup"; + owner = "bup"; + rev = version; + hash = "sha256-w7yPs7hG4v0Kd9i2tYhWH7vW95MAMfI/8g61MB6bfps="; + }; + + buildInputs = [ git python3 ]; + nativeBuildInputs = [ pandoc perl makeWrapper ]; + + postPatch = "patchShebangs ."; + + dontAddPrefix = true; + + makeFlags = [ + "MANDIR=$(out)/share/man" + "DOCDIR=$(out)/share/doc/bup" + "BINDIR=$(out)/bin" + "LIBDIR=$(out)/lib/bup" + ]; + + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=implicit-function-declaration -Wno-error=implicit-int"; + + postInstall = '' + wrapProgram $out/bin/bup \ + --prefix PATH : ${lib.makeBinPath [ git par2cmdline ]} \ + --prefix NIX_PYTHONPATH : ${lib.makeSearchPathOutput "lib" python3.sitePackages pythonDeps} + ''; + + meta = with lib; { + homepage = "https://github.com/bup/bup"; + description = "Efficient file backup system based on the git packfile format"; + license = licenses.gpl2Plus; + + longDescription = '' + Highly efficient file backup system based on the git packfile format. + Capable of doing *fast* incremental backups of virtual machine images. + ''; + + platforms = platforms.linux ++ platforms.darwin; + maintainers = with maintainers; [ rnhmjoj ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/bupstash/default.nix b/nixpkgs/pkgs/tools/backup/bupstash/default.nix new file mode 100644 index 000000000000..d9b9bc8188b4 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/bupstash/default.nix @@ -0,0 +1,34 @@ +{ lib, fetchFromGitHub, installShellFiles, rustPlatform, ronn, pkg-config, libsodium }: +rustPlatform.buildRustPackage rec { + pname = "bupstash"; + version = "0.12.0"; + + src = fetchFromGitHub { + owner = "andrewchambers"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-Ekjxna3u+71s1q7jjXp7PxYUQIfbp2E+jAqKGuszU6g="; + }; + + cargoSha256 = "sha256-hkGmE7WseEjMxmmPyR8C4osbdbpIt8qG9sfVGuC4d84="; + + nativeBuildInputs = [ ronn pkg-config installShellFiles ]; + buildInputs = [ libsodium ]; + + postBuild = '' + RUBYOPT="-KU -E utf-8:utf-8" ronn -r doc/man/*.md + ''; + + postInstall = '' + installManPage doc/man/*.[1-9] + ''; + + meta = with lib; { + description = "Easy and efficient encrypted backups"; + homepage = "https://bupstash.io"; + license = licenses.mit; + platforms = platforms.unix; + maintainers = with maintainers; [ andrewchambers ]; + mainProgram = "bupstash"; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/burp/default.nix b/nixpkgs/pkgs/tools/backup/burp/default.nix new file mode 100644 index 000000000000..d78e75685f05 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/burp/default.nix @@ -0,0 +1,41 @@ +{ lib, stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, pkg-config +, acl, librsync, ncurses, openssl_legacy, zlib, uthash }: + +stdenv.mkDerivation rec { + pname = "burp"; + version = "2.4.0"; + + src = fetchFromGitHub { + owner = "grke"; + repo = "burp"; + rev = version; + sha256 = "sha256-y6kRd1jD6t+Q6d5t7W9MDuk+m2Iq1THQkP50PJwI7Nc="; + }; + + patches = [ + # Pull upstream fix for ncurses-6.3 support + (fetchpatch { + name = "ncurses-6.3.patch"; + url = "https://github.com/grke/burp/commit/1d6c931af7c11f164cf7ad3479781e8f03413496.patch"; + sha256 = "14sfbfahlankz3xg6v10i8fnmpnmqpp73q9xm0l0hnjh25igv6bl"; + }) + ]; + + nativeBuildInputs = [ autoreconfHook pkg-config ]; + # use openssl_legacy due to burp-2.4.0 not supporting file encryption with openssl 3.0 + # replace with 'openssl' once burp-3.x has been declared stable and this package upgraded + buildInputs = [ librsync ncurses openssl_legacy zlib uthash ] + ++ lib.optional (!stdenv.isDarwin) acl; + + configureFlags = [ "--localstatedir=/var" ]; + + installFlags = [ "localstatedir=/tmp" ]; + + meta = with lib; { + description = "BURP - BackUp and Restore Program"; + homepage = "https://burp.grke.org"; + license = licenses.agpl3; + maintainers = with maintainers; [ arjan-s ]; + platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/chunksync/default.nix b/nixpkgs/pkgs/tools/backup/chunksync/default.nix new file mode 100644 index 000000000000..2bab8d5ea22e --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/chunksync/default.nix @@ -0,0 +1,32 @@ +{ lib, stdenv, fetchurl, openssl, perl }: + +stdenv.mkDerivation rec { + version = "0.4"; + pname = "chunksync"; + + src = fetchurl { + url = "https://chunksync.florz.de/chunksync_${version}.tar.gz"; + sha256 = "1gwqp1kjwhcmwhynilakhzpzgc0c6kk8c9vkpi30gwwrwpz3cf00"; + }; + + buildInputs = [openssl perl]; + + NIX_LDFLAGS = "-lgcc_s"; + + makeFlags = [ + "DESTDIR=$(out)" + "PREFIX=" + ]; + + preInstall = '' + mkdir -p $out/bin + mkdir -p $out/share/man/man1 + ''; + + meta = { + description = "Space-efficient incremental backups of large files or block devices"; + homepage = "http://chunksync.florz.de/"; + license = lib.licenses.gpl2; + platforms = with lib.platforms; linux; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/conserve/default.nix b/nixpkgs/pkgs/tools/backup/conserve/default.nix new file mode 100644 index 000000000000..a3f4dc3f734c --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/conserve/default.nix @@ -0,0 +1,26 @@ +{ lib +, rustPlatform +, fetchFromGitHub +}: + +rustPlatform.buildRustPackage rec { + pname = "conserve"; + version = "23.11.0"; + + src = fetchFromGitHub { + owner = "sourcefrog"; + repo = "conserve"; + rev = "v${version}"; + hash = "sha256-Ck2+3etwfZiDMZHzI2hIBuUKn7L0ZTGEe9yJjXjoRIM="; + }; + + cargoHash = "sha256-tMj1icGNTFpouts1TE6BIiABexV3vmOW9r5Y/7ynUMM="; + + meta = with lib; { + description = "Robust portable backup tool in Rust"; + homepage = "https://github.com/sourcefrog/conserve"; + license = licenses.gpl2Only; + maintainers = with maintainers; [ happysalada ]; + mainProgram = "conserve"; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/dar/default.nix b/nixpkgs/pkgs/tools/backup/dar/default.nix new file mode 100644 index 000000000000..96eeeb39a9cb --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/dar/default.nix @@ -0,0 +1,82 @@ +{ + lib, + stdenv, + fetchzip, + which, + attr, + e2fsprogs, + curl, + libargon2, + librsync, + libthreadar, + gpgme, + libgcrypt, + openssl, + bzip2, + lz4, + lzo, + xz, + zlib, + zstd, + CoreFoundation, +}: + +stdenv.mkDerivation rec { + version = "2.7.13"; + pname = "dar"; + + src = fetchzip { + url = "mirror://sourceforge/dar/${pname}-${version}.tar.gz"; + sha256 = "sha256-d88BwbovhbAn72y5pVd4No+hVydXbtZYHZpdtpo4RGY="; + }; + + outputs = [ "out" "dev" ]; + + nativeBuildInputs = [ which ]; + + buildInputs = [ + curl + librsync + libthreadar + gpgme + libargon2 + libgcrypt + openssl + bzip2 + lz4 + lzo + xz + zlib + zstd + ] ++ lib.optionals stdenv.isLinux [ + attr + e2fsprogs + ] ++ lib.optionals stdenv.isDarwin [ + CoreFoundation + ]; + + configureFlags = [ + "--disable-birthtime" + "--disable-upx" + "--disable-dar-static" + "--disable-build-html" + "--enable-threadar" + ]; + + hardeningDisable = [ "format" ]; + + enableParallelBuilding = true; + + postInstall = '' + # Disable html help + rm -r "$out"/share/dar + ''; + + meta = with lib; { + homepage = "http://dar.linux.free.fr"; + description = "Disk ARchiver, allows backing up files into indexed archives"; + maintainers = with maintainers; [ izorkin ]; + license = licenses.gpl2Only; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/dedup/default.nix b/nixpkgs/pkgs/tools/backup/dedup/default.nix new file mode 100644 index 000000000000..15daab4751e9 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/dedup/default.nix @@ -0,0 +1,34 @@ +{ lib, stdenv, fetchurl, lz4, snappy, libsodium +# For testing +, coreutils, gawk +}: + +stdenv.mkDerivation rec { + pname = "dedup"; + version = "2.0"; + + src = fetchurl { + url = "https://dl.2f30.org/releases/${pname}-${version}.tar.gz"; + sha256 = "0n5kkni4d6blz3s94y0ddyhijb74lxv7msr2mvdmj8l19k0lrfh1"; + }; + + makeFlags = [ + "CC:=$(CC)" + "PREFIX=${placeholder "out"}" + "MANPREFIX=${placeholder "out"}/share/man" + ]; + + buildInputs = [ lz4 snappy libsodium ]; + + doCheck = true; + + nativeCheckInputs = [ coreutils gawk ]; + checkTarget = "test"; + + meta = with lib; { + description = "Data deduplication program"; + homepage = "https://git.2f30.org/dedup/file/README.html"; + license = with licenses; [ bsd0 isc ]; + maintainers = with maintainers; [ dtzWill ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/dirvish/default.nix b/nixpkgs/pkgs/tools/backup/dirvish/default.nix new file mode 100644 index 000000000000..4f99e60f4dbe --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/dirvish/default.nix @@ -0,0 +1,64 @@ +{ fetchurl, lib, stdenv, makeWrapper, perl, perlPackages }: + +stdenv.mkDerivation rec { + pname = "dirvish"; + version = "1.2.1"; + + src = fetchurl { + url = "http://dirvish.org/dirvish${version}.tgz"; + sha256 = "6b7f29c3541448db3d317607bda3eb9bac9fb3c51f970611ffe27e9d63507dcd"; + }; + + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ perl ] ++ (with perlPackages; [ GetoptLong TimeParseDate TimePeriod ]); + + executables = [ "dirvish" "dirvish-runall" "dirvish-expire" "dirvish-locate" ]; + manpages = [ "dirvish.8" "dirvish-runall.8" "dirvish-expire.8" "dirvish-locate.8" "dirvish.conf.5" ]; + + buildPhase = '' + HEADER="#!${perl}/bin/perl + + \$CONFDIR = \"/etc/dirvish\"; + + " + + for executable in $executables; do + ( + echo "$HEADER" + cat $executable.pl loadconfig.pl + ) > $executable + chmod +x $executable + done + ''; + + installPhase = '' + mkdir -p $out/bin + cp --target-directory=$out/bin $executables + + for manpage in $manpages; do + if [[ $manpage =~ \.([[:digit:]]+)$ ]]; then + section=''${BASH_REMATCH[1]} + mkdir -p $out/man/man$section + cp --target-directory=$out/man/man$section $manpage + else + echo "Couldn't determine man page section by filename" + exit 1 + fi + done + ''; + + postFixup = '' + for executable in $executables; do + wrapProgram $out/bin/$executable \ + --set PERL5LIB "$PERL5LIB" + done + ''; + + meta = with lib; { + description = "Fast, disk based, rotating network backup system"; + homepage = "http://dirvish.org/"; + license = lib.licenses.osl2; + platforms = platforms.linux; + maintainers = [ maintainers.winpat ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/discordchatexporter-cli/default.nix b/nixpkgs/pkgs/tools/backup/discordchatexporter-cli/default.nix new file mode 100644 index 000000000000..518113e0b217 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/discordchatexporter-cli/default.nix @@ -0,0 +1,46 @@ +{ lib +, buildDotnetModule +, dotnetCorePackages +, fetchFromGitHub +, testers +, discordchatexporter-cli +}: + +buildDotnetModule rec { + pname = "discordchatexporter-cli"; + version = "2.41.2"; + + src = fetchFromGitHub { + owner = "tyrrrz"; + repo = "discordchatexporter"; + rev = version; + hash = "sha256-8ETEIZXIo7Tx6Vb9Id/E/8IklpcvO9OpcrYD+mHRX3o="; + }; + + projectFile = "DiscordChatExporter.Cli/DiscordChatExporter.Cli.csproj"; + nugetDeps = ./deps.nix; + dotnet-sdk = dotnetCorePackages.sdk_7_0; + dotnet-runtime = dotnetCorePackages.runtime_7_0; + + postFixup = '' + ln -s $out/bin/DiscordChatExporter.Cli $out/bin/discordchatexporter-cli + ''; + + passthru = { + updateScript = ./updater.sh; + tests.version = testers.testVersion { + package = discordchatexporter-cli; + version = "v${version}"; + }; + }; + + meta = with lib; { + description = "A tool to export Discord chat logs to a file"; + homepage = "https://github.com/Tyrrrz/DiscordChatExporter"; + license = licenses.gpl3Plus; + changelog = "https://github.com/Tyrrrz/DiscordChatExporter/blob/${version}/Changelog.md"; + maintainers = with maintainers; [ eclairevoyant ivar ]; + platforms = [ "x86_64-linux" ]; + mainProgram = "discordchatexporter-cli"; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/discordchatexporter-cli/deps.nix b/nixpkgs/pkgs/tools/backup/discordchatexporter-cli/deps.nix new file mode 100644 index 000000000000..36fe79638043 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/discordchatexporter-cli/deps.nix @@ -0,0 +1,23 @@ +# This file was automatically generated by passthru.fetch-deps. +# Please dont edit it manually, your changes might get overwritten! + +{ fetchNuGet }: [ + (fetchNuGet { pname = "AdvancedStringBuilder"; version = "0.1.0"; sha256 = "1lpv5sggdxza0bmcqmzf5r4i340f0m7nr5073lac18naj5697q5g"; }) + (fetchNuGet { pname = "AngleSharp"; version = "1.0.4"; sha256 = "1b4qd0z27fdkgy5l8fqcbpzwm29gmmjm2h0mqb9ac94rv6ynq510"; }) + (fetchNuGet { pname = "AsyncKeyedLock"; version = "6.2.1"; sha256 = "0281mj9ppz6q454li6xyllb1hdfkl59bh3psbj4z6l9xjbhnjhz0"; }) + (fetchNuGet { pname = "CliFx"; version = "2.3.4"; sha256 = "14nj8w3j0hbsr5cghj39jx2sh5cg3wsvl517dk8whva5kgy3q1mf"; }) + (fetchNuGet { pname = "CSharpier.MsBuild"; version = "0.25.0"; sha256 = "0xpdb2mss9zhdpks9ajm2h611khhw69xjwxv1k6qf7qrbkb0rgr3"; }) + (fetchNuGet { pname = "Deorcify"; version = "1.0.2"; sha256 = "0nwxyrl4rd5x621i2hs5fl3w7fxpm13lkdssxr9fd5042px2gqbm"; }) + (fetchNuGet { pname = "DotnetRuntimeBootstrapper"; version = "2.5.1"; sha256 = "192795akjmdxvp8p52g256rg0nzriipfsr8j808h69j6himhp4d7"; }) + (fetchNuGet { pname = "Gress"; version = "2.1.1"; sha256 = "1svz1flhyl26h3xjch0acjjinympgf6bhj5vpb188njfih3ip4ck"; }) + (fetchNuGet { pname = "JsonExtensions"; version = "1.2.0"; sha256 = "0g54hibabbqqfhxjlnxwv1rxagpali5agvnpymp2w3dk8h6q66xy"; }) + (fetchNuGet { pname = "Polly"; version = "8.0.0"; sha256 = "08wzmkz9qjz61sczmipm8m5j4bg8dg4mbjgspagx4hh28q8mvagn"; }) + (fetchNuGet { pname = "Polly.Core"; version = "8.0.0"; sha256 = "10w6z81kidkdhbwkhyas9kc1zmvz0r3mzcsii01wpydw27v0rzxp"; }) + (fetchNuGet { pname = "RazorBlade"; version = "0.4.4"; sha256 = "1dkyyn58gcrl1sh6mv3g7zqapqg8lb5nzn10aj3vh4l51wpl0l5r"; }) + (fetchNuGet { pname = "Spectre.Console"; version = "0.47.0"; sha256 = "0gc9ana660an7d76w9qd8l62lv66dc69vr5lslr896b1313ywakp"; }) + (fetchNuGet { pname = "Superpower"; version = "3.0.0"; sha256 = "0p6riay4732j1fahc081dzgs9q4z3n2fpxrin4zfpj6q2226dhz4"; }) + (fetchNuGet { pname = "System.Memory"; version = "4.5.5"; sha256 = "08jsfwimcarfzrhlyvjjid61j02irx6xsklf32rv57x2aaikvx0h"; }) + (fetchNuGet { pname = "System.Text.Encoding.CodePages"; version = "7.0.0"; sha256 = "0sn6hxdjm7bw3xgsmg041ccchsa4sp02aa27cislw3x61dbr68kq"; }) + (fetchNuGet { pname = "WebMarkupMin.Core"; version = "2.14.0"; sha256 = "0c41zw1bwz6ybxagq5vr26cx7najd17rrdbqjpn8mabynq380ayr"; }) + (fetchNuGet { pname = "YoutubeExplode"; version = "6.3.4"; sha256 = "0zlfga8aigxxqa96jmqsp95h5plvxxlgymsrbcl5z1ds9ga0ldkd"; }) +] diff --git a/nixpkgs/pkgs/tools/backup/discordchatexporter-cli/updater.sh b/nixpkgs/pkgs/tools/backup/discordchatexporter-cli/updater.sh new file mode 100755 index 000000000000..cc81761b93d9 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/discordchatexporter-cli/updater.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env nix-shell +#!nix-shell -I nixpkgs=./. -i bash -p curl jq common-updater-scripts +set -eo pipefail +cd "$(dirname "${BASH_SOURCE[0]}")" + +new_version="$(curl -s "https://api.github.com/repos/tyrrrz/DiscordChatExporter/releases?per_page=1" | jq -r '.[0].name')" +old_version="$(sed -nE 's/\s*version = "(.*)".*/\1/p' ./default.nix)" +if [[ "$new_version" == "$old_version" ]]; then + echo "Up to date" + exit 0 +fi + +cd ../../../.. +update-source-version discordchatexporter-cli "$new_version" +$(nix-build -A discordchatexporter-cli.fetch-deps --no-out-link) diff --git a/nixpkgs/pkgs/tools/backup/diskrsync/default.nix b/nixpkgs/pkgs/tools/backup/diskrsync/default.nix new file mode 100644 index 000000000000..9154451a2441 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/diskrsync/default.nix @@ -0,0 +1,30 @@ +{ buildGoModule, fetchFromGitHub, lib, openssh, makeWrapper }: + +buildGoModule rec { + pname = "diskrsync"; + version = "1.3.0"; + + src = fetchFromGitHub { + owner = "dop251"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-hM70WD+M3jwze0IG84WTFf1caOUk2s9DQ7pR+KNIt1M="; + }; + + vendorHash = "sha256-lJaM/sC5/qmmo7Zu7nGR6ZdXa1qw4SuVxawQ+d/m+Aw="; + + ldflags = [ "-s" "-w" ]; + + nativeBuildInputs = [ makeWrapper ]; + + preFixup = '' + wrapProgram "$out/bin/diskrsync" --argv0 diskrsync --prefix PATH : ${openssh}/bin + ''; + + meta = with lib; { + description = "Rsync for block devices and disk images"; + homepage = "https://github.com/dop251/diskrsync"; + license = licenses.mit; + maintainers = with maintainers; [ jluttine ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/dump/default.nix b/nixpkgs/pkgs/tools/backup/dump/default.nix new file mode 100644 index 000000000000..f9e1b68ac395 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/dump/default.nix @@ -0,0 +1,25 @@ +# Tested with simple dump and restore -i, but complains that +# /nix/store/.../etc/dumpdates doesn't exist. + +{ lib, stdenv, fetchurl, pkg-config, + e2fsprogs, ncurses, readline }: + +stdenv.mkDerivation rec { + pname = "dump"; + version = "0.4b47"; + + src = fetchurl { + url = "mirror://sourceforge/dump/dump-${version}.tar.gz"; + sha256 = "sha256-0CGs3k+77T2T662YFCL2cfSNZrKeyI196DZC7Pv/T9A="; + }; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ e2fsprogs ncurses readline ]; + + meta = with lib; { + homepage = "https://dump.sourceforge.io/"; + description = "Linux Ext2 filesystem dump/restore utilities"; + license = licenses.bsd3; + maintainers = with maintainers; [ falsifian ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/duplicacy/default.nix b/nixpkgs/pkgs/tools/backup/duplicacy/default.nix new file mode 100644 index 000000000000..55abb3462ee4 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/duplicacy/default.nix @@ -0,0 +1,25 @@ +{ lib, buildGoModule, fetchFromGitHub }: + +buildGoModule rec { + pname = "duplicacy"; + version = "3.2.3"; + + src = fetchFromGitHub { + owner = "gilbertchen"; + repo = "duplicacy"; + rev = "v${version}"; + hash = "sha256-7LflTRBB4JG84QM46wvSJrP4o3CHV4gnR24RJgDSlDg="; + }; + + vendorHash = "sha256-4M/V4vP9XwHBkZ6UwsAxZ81YAzP4inuNC5yI+5ygQsA="; + + doCheck = false; + + meta = with lib; { + homepage = "https://duplicacy.com"; + description = "A new generation cloud backup tool"; + platforms = platforms.linux ++ platforms.darwin; + license = lib.licenses.unfree; + maintainers = with maintainers; [ ffinkdevs devusb ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/duplicati/default.nix b/nixpkgs/pkgs/tools/backup/duplicati/default.nix new file mode 100644 index 000000000000..3667b4afda47 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/duplicati/default.nix @@ -0,0 +1,37 @@ +{ lib, stdenv, fetchzip, mono, sqlite, makeWrapper }: + +stdenv.mkDerivation rec { + pname = "duplicati"; + version = "2.0.7.1"; + channel = "beta"; + build_date = "2023-05-25"; + + src = fetchzip { + url = "https://github.com/duplicati/duplicati/releases/download/v${version}-${version}_${channel}_${build_date}/duplicati-${version}_${channel}_${build_date}.zip"; + hash = "sha256-isPmRC6N+gEZgvJ0bgeFf5kOQJsicZOsGnT+CAGgg+U="; + stripRoot = false; + }; + + nativeBuildInputs = [ makeWrapper ]; + + installPhase = '' + mkdir -p $out/{bin,share/${pname}-${version}} + cp -r * $out/share/${pname}-${version} + makeWrapper "${mono}/bin/mono" $out/bin/duplicati-cli \ + --add-flags "$out/share/${pname}-${version}/Duplicati.CommandLine.exe" \ + --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ + sqlite ]} + makeWrapper "${mono}/bin/mono" $out/bin/duplicati-server \ + --add-flags "$out/share/${pname}-${version}/Duplicati.Server.exe" \ + --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ + sqlite ]} + ''; + + meta = with lib; { + description = "A free backup client that securely stores encrypted, incremental, compressed backups on cloud storage services and remote file servers"; + homepage = "https://www.duplicati.com/"; + license = licenses.lgpl21; + maintainers = with maintainers; [ nyanloutre ]; + platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/duplicity/default.nix b/nixpkgs/pkgs/tools/backup/duplicity/default.nix new file mode 100644 index 000000000000..452fab128e14 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/duplicity/default.nix @@ -0,0 +1,130 @@ +{ lib +, stdenv +, fetchFromGitLab +, python3 +, librsync +, ncftp +, gnupg +, gnutar +, par2cmdline +, util-linux +, rsync +, makeWrapper +, gettext +}: + +python3.pkgs.buildPythonApplication rec { + pname = "duplicity"; + version = "0.8.23"; + + src = fetchFromGitLab { + owner = "duplicity"; + repo = "duplicity"; + rev = "rel.${version}"; + sha256 = "0my015zc8751smjgbsysmca7hvdm96cjw5zilqn3zq971nmmrksb"; + }; + + patches = [ + # We use the tar binary on all platforms. + ./gnutar-in-test.patch + + # Our Python infrastructure runs test in installCheckPhase so we need + # to make the testing code stop assuming it is run from the source directory. + ./use-installed-scripts-in-test.patch + ] ++ lib.optionals stdenv.isLinux [ + # Broken on Linux in Nix' build environment + ./linux-disable-timezone-test.patch + ]; + + preConfigure = '' + # fix version displayed by duplicity --version + # see SourceCopy in setup.py + ls + for i in bin/*.1 duplicity/__init__.py; do + substituteInPlace "$i" --replace '$version' "${version}" + done + ''; + + nativeBuildInputs = [ + makeWrapper + gettext + python3.pkgs.wrapPython + python3.pkgs.setuptools-scm + ]; + + buildInputs = [ + librsync + ]; + + pythonPath = with python3.pkgs; [ + b2sdk + boto3 + cffi + cryptography + ecdsa + idna + pygobject3 + fasteners + lockfile + paramiko + pyasn1 + pycrypto + pydrive2 + future + ]; + + nativeCheckInputs = [ + gnupg # Add 'gpg' to PATH. + gnutar # Add 'tar' to PATH. + librsync # Add 'rdiff' to PATH. + par2cmdline # Add 'par2' to PATH. + ] ++ lib.optionals stdenv.isLinux [ + util-linux # Add 'setsid' to PATH. + ] ++ (with python3.pkgs; [ + lockfile + mock + pexpect + pytest + pytest-runner + ]); + + postInstall = '' + wrapProgram $out/bin/duplicity \ + --prefix PATH : "${lib.makeBinPath [ gnupg ncftp rsync ]}" + ''; + + preCheck = '' + wrapPythonProgramsIn "$PWD/testing/overrides/bin" "$pythonPath" + + # Add 'duplicity' to PATH for tests. + # Normally, 'setup.py test' adds 'build/scripts-2.7/' to PATH before running + # tests. However, 'build/scripts-2.7/duplicity' is not wrapped, so its + # shebang is incorrect and it fails to run inside Nix' sandbox. + # In combination with use-installed-scripts-in-test.patch, make 'setup.py + # test' use the installed 'duplicity' instead. + PATH="$out/bin:$PATH" + + # Don't run developer-only checks (pep8, etc.). + export RUN_CODE_TESTS=0 + + # check version string + duplicity --version | grep ${version} + '' + lib.optionalString stdenv.isDarwin '' + # Work around the following error when running tests: + # > Max open files of 256 is too low, should be >= 1024. + # > Use 'ulimit -n 1024' or higher to correct. + ulimit -n 1024 + ''; + + # TODO: Fix test failures on macOS 10.13: + # + # > OSError: out of pty devices + doCheck = !stdenv.isDarwin; + + meta = with lib; { + description = "Encrypted bandwidth-efficient backup using the rsync algorithm"; + homepage = "https://duplicity.gitlab.io/duplicity-web/"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/duplicity/gnutar-in-test.patch b/nixpkgs/pkgs/tools/backup/duplicity/gnutar-in-test.patch new file mode 100644 index 000000000000..ee95b68e2abb --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/duplicity/gnutar-in-test.patch @@ -0,0 +1,20 @@ +diff --git a/testing/functional/test_restart.py b/testing/functional/test_restart.py +index 6d972c82..e8435fd5 100644 +--- a/testing/functional/test_restart.py ++++ b/testing/functional/test_restart.py +@@ -350,14 +350,7 @@ class RestartTestWithoutEncryption(RestartTest): + https://launchpad.net/bugs/929067 + """ + +- if platform.system().startswith(u'Linux'): +- tarcmd = u"tar" +- elif platform.system().startswith(u'Darwin'): +- tarcmd = u"gtar" +- elif platform.system().endswith(u'BSD'): +- tarcmd = u"gtar" +- else: +- raise Exception(u"Platform %s not supported by tar/gtar." % platform.platform()) ++ tarcmd = u"tar" + + # Intial normal backup + self.backup(u"full", u"{0}/testfiles/blocktartest".format(_runtest_dir)) diff --git a/nixpkgs/pkgs/tools/backup/duplicity/linux-disable-timezone-test.patch b/nixpkgs/pkgs/tools/backup/duplicity/linux-disable-timezone-test.patch new file mode 100644 index 000000000000..e322625cdbf4 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/duplicity/linux-disable-timezone-test.patch @@ -0,0 +1,16 @@ +commit f0142706c377b7c133753db57b5c4c90baa2de30 +Author: Guillaume Girol <symphorien+git@xlumurb.eu> +Date: Sun Jul 11 17:48:15 2021 +0200 + +diff --git a/testing/unit/test_statistics.py b/testing/unit/test_statistics.py +index 4be5000c..80545853 100644 +--- a/testing/unit/test_statistics.py ++++ b/testing/unit/test_statistics.py +@@ -63,6 +63,7 @@ class StatsObjTest(UnitTestCase): + s1 = StatsDeltaProcess() + assert s1.get_stat(u'SourceFiles') == 0 + ++ @unittest.skip("Broken on Linux in Nix' build environment") + def test_get_stats_string(self): + u"""Test conversion of stat object into string""" + s = StatsObj() diff --git a/nixpkgs/pkgs/tools/backup/duplicity/use-installed-scripts-in-test.patch b/nixpkgs/pkgs/tools/backup/duplicity/use-installed-scripts-in-test.patch new file mode 100644 index 000000000000..a5ddc4381bd8 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/duplicity/use-installed-scripts-in-test.patch @@ -0,0 +1,63 @@ +commit ccd4dd92cd37acce1da20966ad9e4e0c7bcf1709 +Author: Guillaume Girol <symphorien+git@xlumurb.eu> +Date: Sun Jul 11 12:00:00 2021 +0000 + + use installed duplicity when running tests + +diff --git a/setup.py b/setup.py +index fa474f20..604a242a 100755 +--- a/setup.py ++++ b/setup.py +@@ -205,10 +205,6 @@ class TestCommand(test): + except Exception: + pass + +- os.environ[u'PATH'] = u"%s:%s" % ( +- os.path.abspath(build_scripts_cmd.build_dir), +- os.environ.get(u'PATH')) +- + test.run(self) + + +diff --git a/testing/functional/__init__.py b/testing/functional/__init__.py +index 4221576d..3cf44945 100644 +--- a/testing/functional/__init__.py ++++ b/testing/functional/__init__.py +@@ -111,7 +111,7 @@ class FunctionalTestCase(DuplicityTestCase): + run_coverage = os.environ.get(u'RUN_COVERAGE', None) + if run_coverage is not None: + cmd_list.extend([u"-m", u"coverage", u"run", u"--source=duplicity", u"-p"]) +- cmd_list.extend([u"{0}/bin/duplicity".format(_top_dir)]) ++ cmd_list.extend([u"duplicity"]) + cmd_list.extend(options) + cmd_list.extend([u"-v0"]) + cmd_list.extend([u"--no-print-statistics"]) +diff --git a/testing/functional/test_log.py b/testing/functional/test_log.py +index 9dfc86a6..b9cb55db 100644 +--- a/testing/functional/test_log.py ++++ b/testing/functional/test_log.py +@@ -49,9 +49,9 @@ class LogTest(FunctionalTestCase): + # Run actual duplicity command (will fail, because no arguments passed) + basepython = os.environ.get(u'TOXPYTHON', None) + if basepython is not None: +- os.system(u"{0} {1}/bin/duplicity --log-file={2} >/dev/null 2>&1".format(basepython, _top_dir, self.logfile)) ++ os.system(u"{0} duplicity --log-file={1} >/dev/null 2>&1".format(basepython, self.logfile)) + else: +- os.system(u"{0}/bin/duplicity --log-file={1} >/dev/null 2>&1".format(_top_dir, self.logfile)) ++ os.system(u"duplicity --log-file={0} >/dev/null 2>&1".format(self.logfile)) + + # The format of the file should be: + # """ERROR 2 +diff --git a/testing/functional/test_rdiffdir.py b/testing/functional/test_rdiffdir.py +index 0cbfdb33..47acd029 100644 +--- a/testing/functional/test_rdiffdir.py ++++ b/testing/functional/test_rdiffdir.py +@@ -44,7 +44,7 @@ class RdiffdirTest(FunctionalTestCase): + basepython = os.environ.get(u'TOXPYTHON', None) + if basepython is not None: + cmd_list.extend([basepython]) +- cmd_list.extend([u"{0}/bin/rdiffdir".format(_top_dir)]) ++ cmd_list.extend([u"rdiffdir"]) + cmd_list.extend(argstring.split()) + cmdline = u" ".join([u'"%s"' % x for x in cmd_list]) + self.run_cmd(cmdline) diff --git a/nixpkgs/pkgs/tools/backup/duply/default.nix b/nixpkgs/pkgs/tools/backup/duply/default.nix new file mode 100644 index 000000000000..66c31ddd0e16 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/duply/default.nix @@ -0,0 +1,41 @@ +{ lib, stdenv, fetchurl, coreutils, python3, duplicity, gawk, gnupg, bash +, gnugrep, txt2man, makeWrapper, which +}: + +stdenv.mkDerivation rec { + pname = "duply"; + version = "2.4"; + + src = fetchurl { + url = "mirror://sourceforge/project/ftplicity/duply%20%28simple%20duplicity%29/2.4.x/duply_${version}.tgz"; + hash = "sha256-DCrp3o/ukzkfnVaLbIK84bmYnXvqKsvlkGn3GJY3iNg="; + }; + + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ txt2man ]; + + postPatch = "patchShebangs ."; + + installPhase = '' + mkdir -p "$out/bin" + mkdir -p "$out/share/man/man1" + install -vD duply "$out/bin" + wrapProgram "$out/bin/duply" --prefix PATH : \ + ${lib.makeBinPath [ coreutils python3 duplicity gawk gnupg bash gnugrep txt2man which ]} + "$out/bin/duply" txt2man > "$out/share/man/man1/duply.1" + ''; + + meta = with lib; { + description = "Shell front end for the duplicity backup tool"; + longDescription = '' + Duply is a shell front end for the duplicity backup tool + https://www.nongnu.org/duplicity. It greatly simplifies its usage by + implementing backup job profiles, batch commands and more. Who says + secure backups on non-trusted spaces are no child's play? + ''; + homepage = "https://duply.net/"; + license = licenses.gpl2; + maintainers = [ maintainers.bjornfor ]; + platforms = lib.platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/easysnap/default.nix b/nixpkgs/pkgs/tools/backup/easysnap/default.nix new file mode 100644 index 000000000000..46952ce5327a --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/easysnap/default.nix @@ -0,0 +1,31 @@ +{lib, stdenv, fetchFromGitHub, zfs }: + +stdenv.mkDerivation { + pname = "easysnap"; + version = "unstable-2022-06-03"; + + src = fetchFromGitHub { + owner = "sjau"; + repo = "easysnap"; + rev = "5f961442315a6f7eb8ca5b705bd52fe1e6d7dc42"; + sha256 = "sha256-jiKdpwuw0Oil0sxUr/3KJ6Nbfxh8DvBei0yy0nRM+Vs="; + }; + + installPhase = '' + mkdir -p $out/bin + cp easysnap* $out/bin/ + + for i in $out/bin/*; do + substituteInPlace $i \ + --replace zfs ${zfs}/bin/zfs + done + ''; + + meta = with lib; { + homepage = "https://github.com/sjau/easysnap"; + description = "Customizable ZFS Snapshotting tool with zfs send/recv pulling"; + license = licenses.gpl3; + maintainers = with maintainers; [ sjau ]; + }; + +} diff --git a/nixpkgs/pkgs/tools/backup/fabs/default.nix b/nixpkgs/pkgs/tools/backup/fabs/default.nix new file mode 100644 index 000000000000..f6e9ec291585 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/fabs/default.nix @@ -0,0 +1,67 @@ +{ lib +, fetchFromGitHub +, perl +, python3 +, sqlite +}: + +python3.pkgs.buildPythonApplication rec { + pname = "fabs"; + version = "1.1"; + format = "setuptools"; + + src = fetchFromGitHub { + owner = "openafs-contrib"; + repo = "fabs"; + rev = "v${version}"; + hash = "sha256-ejAcCwrOWGX0zsMw224f9GTWlozNYC0gU6LdTk0XqH0="; + }; + + nativeBuildInputs = [ + perl + ]; + + propagatedBuildInputs = with python3.pkgs; [ + alembic + python-dateutil + pyyaml + setuptools + sqlalchemy + ]; + + outputs = [ "out" "man" ]; + + preBuild = '' + export PREFIX=$out + ''; + + LOCALSTATEDIR = "/var"; + LOCKDIR = "/run/lock/fabs"; + + preInstall = '' + mkdir -p "$out/etc" + cp -t "$out/etc" -r etc/fabs + ''; + + # remove once sqlalchemy backend no longer uses deprecated methods + SQLALCHEMY_SILENCE_UBER_WARNING = 1; + + nativeCheckInputs = [ + python3.pkgs.pytestCheckHook + sqlite + ]; + + meta = with lib; { + outputsToInstall = [ "out" "man" ]; + mainProgram = "fabsys"; + description = "Flexible AFS Backup System for the OpenAFS distributed file system"; + homepage = "https://github.com/openafs-contrib/fabs"; + license = with licenses; [ isc ]; + maintainers = with maintainers; [ spacefrogg ]; + broken = lib.versionAtLeast python3.pkgs.sqlalchemy.version "2.0"; + badPlatforms = [ + "x86_64-darwin" + "aarch64-darwin" + ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/flockit/default.nix b/nixpkgs/pkgs/tools/backup/flockit/default.nix new file mode 100644 index 000000000000..cd17f8e2438c --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/flockit/default.nix @@ -0,0 +1,51 @@ +{ lib, stdenv, fetchFromGitHub, runtimeShell }: + +stdenv.mkDerivation { + pname = "flockit"; + version = "2012-08-11"; + + src = fetchFromGitHub { + owner = "smerritt"; + repo = "flockit"; + rev = "5c2b2092f8edcc8e3e2eb6ef66c968675dbfa686"; + sha256 = "0vajck9q2677gpn9a4flkyz7mw69ql1647cjwqh834nrcr2b5164"; + }; + + installPhase = '' + mkdir -p $out/lib $out/bin + cp ./libflockit.so $out/lib + + (cat <<EOI + #!${runtimeShell} + env LD_PRELOAD="$out/lib/libflockit.so" FLOCKIT_FILE_PREFIX=\$1 \''${@:2} + EOI + ) > $out/bin/flockit + chmod +x $out/bin/flockit + ''; + + meta = with lib; { + description = "LD_PRELOAD shim to add file locking to programs that don't do it (I'm looking at you, rsync!)"; + longDescription = '' + This library and tool exists solely because rsync doesn't have file locking. + + It's not used like a normal library; you don't link against it, and you + don't have to patch your source code to use it. It's inserted between your + program and its libraries by use of LD_PRELOAD. + + For example: + + $ env LD_PRELOAD=$(nix-build -A pkgs.flockit)/lib/libflockit.so FLOCKIT_FILE_PREFIX=test rsync SRC DEST + + Besides the library a handy executable is provided which can simplify the above to: + + $ $(nix-build -A pkgs.flockit)/bin/flockit test rsync SRC DEST + + Also see the following blog post: + https://www.swiftstack.com/blog/2012/08/15/old-school-monkeypatching/ + ''; + homepage = "https://github.com/smerritt/flockit"; + license = licenses.asl20; + platforms = platforms.linux; + maintainers = [ maintainers.basvandijk ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/gamerbackup/default.nix b/nixpkgs/pkgs/tools/backup/gamerbackup/default.nix new file mode 100644 index 000000000000..856da421c55b --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/gamerbackup/default.nix @@ -0,0 +1,30 @@ +{ lib, makeWrapper, buildGoModule, fetchFromGitHub, lepton }: + +buildGoModule { + pname = "gb-backup"; + version = "unstable-2021-10-27"; + + src = fetchFromGitHub { + owner = "leijurv"; + repo = "gb"; + rev = "61383d445af7b035fb8e1df0cacc424340dd16df"; + sha256 = "sha256-YRrD2gW+gzxD2JwadCbF/SBSsHeeGPsa8kKZHHAytVo="; + }; + + vendorHash = "sha256-H3Zf4VNJVX9C3GTeqU4YhNqCIQz1R55MfhrygDgJTxc="; + + nativeBuildInputs = [ makeWrapper ]; + + nativeCheckInputs = [ lepton ]; + + postFixup = '' + wrapProgram $out/bin/gb --prefix PATH : ${lib.makeBinPath [ lepton ]} + ''; + + meta = with lib; { + description = "Gamer Backup, a super opinionated cloud backup system"; + homepage = "https://github.com/leijurv/gb"; + license = licenses.agpl3Only; + maintainers = with maintainers; [ babbaj ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/gh2md/default.nix b/nixpkgs/pkgs/tools/backup/gh2md/default.nix new file mode 100644 index 000000000000..047b838859a4 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/gh2md/default.nix @@ -0,0 +1,28 @@ +{ lib +, python3Packages +, fetchPypi +}: + +python3Packages.buildPythonApplication rec { + pname = "gh2md"; + version = "2.3.1"; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-B7IB1TWfZ0StH2zo/tXfDAaPlgLvr4ciIv7B8EQyp8w="; + }; + + propagatedBuildInputs = with python3Packages; [ six requests python-dateutil ]; + + # uses network + doCheck = false; + + pythonImportsCheck = [ "gh2md" ]; + + meta = with lib; { + description = "Export Github repository issues to markdown files"; + homepage = "https://github.com/mattduck/gh2md"; + license = licenses.mit; + maintainers = with maintainers; [ artturin ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/gphotos-sync/default.nix b/nixpkgs/pkgs/tools/backup/gphotos-sync/default.nix new file mode 100644 index 000000000000..9fefd79c3c62 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/gphotos-sync/default.nix @@ -0,0 +1,61 @@ +{ lib +, fetchFromGitHub +, python3 +, ffmpeg +}: +python3.pkgs.buildPythonApplication rec { + pname = "gphotos-sync"; + version = "3.2.1"; + format = "pyproject"; + + src = fetchFromGitHub { + owner = "gilesknap"; + repo = "gphotos-sync"; + rev = version; + hash = "sha256-iTqD/oUQqC7Fju8SEPkSZX7FC9tE4eRCewiJR8STmEw="; + }; + + patches = [ + ./skip-network-tests.patch + ]; + + nativeBuildInputs = with python3.pkgs; [ + setuptools + setuptools-scm + wheel + ]; + + propagatedBuildInputs = with python3.pkgs; [ + appdirs + attrs + exif + google-auth-oauthlib + psutil + pyyaml + psutil + requests-oauthlib + types-pyyaml + types-requests + ]; + + buildInputs = [ + ffmpeg + ]; + + nativeCheckInputs = with python3.pkgs; [ + mock + pytestCheckHook + ]; + + preCheck = '' + export PY_IGNORE_IMPORTMISMATCH=1 + export HOME=$(mktemp -d) + ''; + + meta = with lib; { + description = "Google Photos and Albums backup with Google Photos Library API"; + homepage = "https://github.com/gilesknap/gphotos-sync"; + license = licenses.asl20; + maintainers = with maintainers; [ dnr ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/gphotos-sync/skip-network-tests.patch b/nixpkgs/pkgs/tools/backup/gphotos-sync/skip-network-tests.patch new file mode 100644 index 000000000000..6f78ed7db3f2 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/gphotos-sync/skip-network-tests.patch @@ -0,0 +1,21 @@ +diff --git a/tests/test_setup.py b/tests/test_setup.py +index 085b110..ea4a7d2 100644 +--- a/tests/test_setup.py ++++ b/tests/test_setup.py +@@ -45,7 +45,8 @@ class SetupDbAndCredentials: + return self + + def __exit__(self, exc_type=None, exc_value=None, traceback=None): +- self.gp.google_photos_down.close() ++ if hasattr(self.gp, 'google_photos_down'): ++ self.gp.google_photos_down.close() + + def test_setup(self, test_name, args=None, trash_db=False, trash_files=False): + self.root = Path("/tmp/gpTests/{}".format(test_name)) +@@ -76,3 +77,6 @@ class SetupDbAndCredentials: + + def test_done(self): + self.gp.data_store.store() ++ ++import pytest, requests ++requests.Session.__init__ = lambda *args, **kwargs: pytest.skip("no network access") diff --git a/nixpkgs/pkgs/tools/backup/gyb/default.nix b/nixpkgs/pkgs/tools/backup/gyb/default.nix new file mode 100644 index 000000000000..fedf02a9b7e6 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/gyb/default.nix @@ -0,0 +1,50 @@ +{ lib +, fetchFromGitHub +, python3 +, python3Packages +}: + +python3Packages.buildPythonApplication rec { + pname = "gyb"; + version = "1.80"; + format = "other"; + + src = fetchFromGitHub { + owner = "GAM-team"; + repo = "got-your-back"; + rev = "refs/tags/v${version}"; + sha256 = "sha256-4xElzhf9R6qnzr4oyZktQy/ym2vEjR9MrHnLYxBiAOg="; + }; + + propagatedBuildInputs = with python3Packages; [ + google-api-python-client + google-auth + google-auth-oauthlib + google-auth-httplib2 + httplib2 + ]; + + installPhase = '' + runHook preInstall + + mkdir -p $out/{bin,${python3.sitePackages}} + mv gyb.py "$out/bin/gyb" + mv *.py "$out/${python3.sitePackages}/" + + runHook postInstall + ''; + + checkPhase = '' + $out/bin/gyb --help > /dev/null + ''; + + meta = with lib; { + description = '' + Got Your Back (GYB) is a command line tool for backing up your Gmail + messages to your computer using Gmail's API over HTTPS. + ''; + homepage = "https://github.com/GAM-team/got-your-back"; + license = licenses.asl20; + maintainers = with maintainers; [ austinbutler ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/hpe-ltfs/default.nix b/nixpkgs/pkgs/tools/backup/hpe-ltfs/default.nix new file mode 100644 index 000000000000..017df9a80073 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/hpe-ltfs/default.nix @@ -0,0 +1,35 @@ +{ lib, stdenv, fetchFromGitHub, fuse, icu66, pkg-config, libxml2, libuuid }: + +stdenv.mkDerivation rec { + version = "3.4.2_Z7550-02501"; + pname = "hpe-ltfs"; + + src = fetchFromGitHub { + rev = version; + owner = "nix-community"; + repo = "hpe-ltfs"; + sha256 = "193593hsc8nf5dn1fkxhzs1z4fpjh64hdkc8q6n9fgplrpxdlr4s"; + }; + + sourceRoot = "${src.name}/ltfs"; + + # include sys/sysctl.h is deprecated in glibc. The sysctl calls are only used + # for Apple to determine the kernel version. Because this build only targets + # Linux is it safe to remove. + patches = [ ./remove-sysctl.patch ]; + + nativeBuildInputs = [ pkg-config ]; + + buildInputs = [ + fuse icu66 libxml2 libuuid + ]; + + meta = with lib; { + description = "HPE's implementation of the open-source tape filesystem standard ltfs"; + homepage = "https://support.hpe.com/hpesc/public/km/product/1009214665/Product"; + license = licenses.lgpl21; + maintainers = [ maintainers.redvers ]; + platforms = platforms.linux; + downloadPage = "https://github.com/nix-community/hpe-ltfs"; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/hpe-ltfs/remove-sysctl.patch b/nixpkgs/pkgs/tools/backup/hpe-ltfs/remove-sysctl.patch new file mode 100644 index 000000000000..35b56522a5bb --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/hpe-ltfs/remove-sysctl.patch @@ -0,0 +1,14 @@ +diff --git a/src/libltfs/arch/arch_info.c b/src/libltfs/arch/arch_info.c +index 179428f..114acf0 100644 +--- a/src/libltfs/arch/arch_info.c ++++ b/src/libltfs/arch/arch_info.c +@@ -47,9 +47,6 @@ + */ + + #include "libltfs/ltfs.h" +-#ifndef mingw_PLATFORM +-#include <sys/sysctl.h> +-#endif + #include <sys/types.h> + #include <sys/stat.h> + #include <unistd.h> diff --git a/nixpkgs/pkgs/tools/backup/httrack/default.nix b/nixpkgs/pkgs/tools/backup/httrack/default.nix new file mode 100644 index 000000000000..8ac3bf740412 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/httrack/default.nix @@ -0,0 +1,22 @@ +{ lib, stdenv, fetchurl, zlib, openssl, libiconv }: + +stdenv.mkDerivation rec { + version = "3.49.2"; + pname = "httrack"; + + src = fetchurl { + url = "https://mirror.httrack.com/httrack-${version}.tar.gz"; + sha256 = "09a0gm67nml86qby1k1gh7rdxamnrnzwr6l9r5iiq94favjs0xrl"; + }; + + buildInputs = [ libiconv openssl zlib ]; + + enableParallelBuilding = true; + + meta = with lib; { + description = "Easy-to-use offline browser / website mirroring utility"; + homepage = "http://www.httrack.com"; + license = licenses.gpl3; + platforms = with platforms; unix; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/httrack/qt.nix b/nixpkgs/pkgs/tools/backup/httrack/qt.nix new file mode 100644 index 000000000000..ed1a75c974aa --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/httrack/qt.nix @@ -0,0 +1,39 @@ +{ stdenv, mkDerivation, lib, fetchurl, cmake, pkg-config, makeWrapper +, httrack, qtbase, qtmultimedia }: + +mkDerivation rec { + pname = "httraqt"; + version = "1.4.9"; + + src = fetchurl { + url = "mirror://sourceforge/httraqt/${pname}-${version}.tar.gz"; + sha256 = "0pjxqnqchpbla4xiq4rklc06484n46cpahnjy03n9rghwwcad25b"; + }; + + buildInputs = [ httrack qtbase qtmultimedia ]; + + nativeBuildInputs = [ cmake makeWrapper pkg-config ]; + + prePatch = '' + substituteInPlace cmake/HTTRAQTFindHttrack.cmake \ + --replace /usr/include/httrack/ ${httrack}/include/httrack/ + + substituteInPlace distribution/posix/CMakeLists.txt \ + --replace /usr/share $out/share + + substituteInPlace desktop/httraqt.desktop \ + --replace Exec=httraqt Exec=$out/bin/httraqt + + substituteInPlace sources/main/httraqt.cpp \ + --replace /usr/share/httraqt/ $out/share/httraqt + ''; + + meta = with lib; { + broken = stdenv.isDarwin; + description = "Easy-to-use offline browser / website mirroring utility - QT frontend"; + homepage = "http://www.httrack.com"; + license = licenses.gpl3; + maintainers = with maintainers; [ peterhoeg ]; + platforms = with platforms; unix; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/iceshelf/default.nix b/nixpkgs/pkgs/tools/backup/iceshelf/default.nix new file mode 100644 index 000000000000..c066cb766951 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/iceshelf/default.nix @@ -0,0 +1,35 @@ +{ lib, fetchFromGitHub, git, awscli, python3 }: + +python3.pkgs.buildPythonApplication rec { + pname = "iceshelf"; + version = "unstable-2019-07-03"; + + format = "other"; + + src = fetchFromGitHub { + owner = "mrworf"; + repo = pname; + rev = "26768dde3fc54fa412e523eb8f8552e866b4853b"; + sha256 = "08rcbd14vn7312rmk2hyvdzvhibri31c4r5lzdrwb1n1y9q761qm"; + }; + + propagatedBuildInputs = [ + git + awscli + python3.pkgs.python-gnupg + ]; + + installPhase = '' + mkdir -p $out/bin $out/share/doc/${pname} $out/${python3.sitePackages} + cp -v iceshelf iceshelf-restore $out/bin + cp -v iceshelf.sample.conf $out/share/doc/${pname}/ + cp -rv modules $out/${python3.sitePackages} + ''; + + meta = with lib; { + description = "A simple tool to allow storage of signed, encrypted, incremental backups using Amazon's Glacier storage"; + license = licenses.lgpl2; + homepage = "https://github.com/mrworf/iceshelf"; + maintainers = with maintainers; [ mmahut ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/kopia/default.nix b/nixpkgs/pkgs/tools/backup/kopia/default.nix new file mode 100644 index 000000000000..3709040490b0 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/kopia/default.nix @@ -0,0 +1,31 @@ +{ lib, buildGoModule, fetchFromGitHub }: + +buildGoModule rec { + pname = "kopia"; + version = "0.15.0"; + + src = fetchFromGitHub { + owner = pname; + repo = pname; + rev = "v${version}"; + hash = "sha256-N6mntK1cHkdnIZhU67DOvlwv8XXWx602oD/Pj+NJo9Y="; + }; + + vendorHash = "sha256-eP/T4UzXBLOuK/f3BTz7dGqsSj7r/uTKKQ4H4lCvPC8="; + + doCheck = false; + + subPackages = [ "." ]; + + ldflags = [ + "-X github.com/kopia/kopia/repo.BuildVersion=${version}" + "-X github.com/kopia/kopia/repo.BuildInfo=${src.rev}" + ]; + + meta = with lib; { + homepage = "https://kopia.io"; + description = "Cross-platform backup tool with fast, incremental backups, client-side end-to-end encryption, compression and data deduplication"; + license = licenses.asl20; + maintainers = [ maintainers.bbigras ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/luckybackup/default.nix b/nixpkgs/pkgs/tools/backup/luckybackup/default.nix new file mode 100644 index 000000000000..61c0c186fe27 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/luckybackup/default.nix @@ -0,0 +1,44 @@ +{ mkDerivation, lib, fetchurl +, pkg-config, libtool, qmake +, rsync, ssh +}: + +mkDerivation rec { + pname = "luckybackup"; + version = "0.5.0"; + + src = fetchurl { + url = "mirror://sourceforge/project/luckybackup/${version}/source/${pname}-${version}.tar.gz"; + sha256 = "0nwjsk1j33pm8882jbj8h6nxn6n5ab9dxqpqkay65pfbhcjay0g8"; + }; + + buildInputs = [ rsync ssh ]; + + nativeBuildInputs = [ pkg-config libtool qmake ]; + + prePatch = '' + for File in luckybackup.pro menu/luckybackup-pkexec \ + menu/luckybackup-su.desktop menu/luckybackup.desktop \ + menu/net.luckybackup.su.policy src/functions.cpp \ + src/global.cpp src/scheduleDialog.cpp; do + substituteInPlace $File --replace "/usr" "$out" + done + ''; + + meta = with lib; { + description = "A powerful, fast and reliable backup & sync tool"; + longDescription = '' + luckyBackup is an application for data back-up and synchronization + powered by the rsync tool. + + It is simple to use, fast (transfers over only changes made and not + all data), safe (keeps your data safe by checking all declared directories + before proceeding in any data manipulation), reliable and fully + customizable. + ''; + homepage = "https://luckybackup.sourceforge.net/"; + license = licenses.gpl3; + maintainers = with maintainers; [ AndersonTorres ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/lvmsync/Gemfile b/nixpkgs/pkgs/tools/backup/lvmsync/Gemfile new file mode 100644 index 000000000000..a87462e2b8a2 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/lvmsync/Gemfile @@ -0,0 +1,2 @@ +source 'https://rubygems.org/' +gem 'lvmsync' diff --git a/nixpkgs/pkgs/tools/backup/lvmsync/Gemfile.lock b/nixpkgs/pkgs/tools/backup/lvmsync/Gemfile.lock new file mode 100644 index 000000000000..5faac2356799 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/lvmsync/Gemfile.lock @@ -0,0 +1,19 @@ +GEM + remote: https://rubygems.org/ + specs: + git-version-bump (0.15.1) + lvmsync (3.3.2) + git-version-bump (~> 0.10) + treetop + polyglot (0.3.5) + treetop (1.6.9) + polyglot (~> 0.3) + +PLATFORMS + ruby + +DEPENDENCIES + lvmsync + +BUNDLED WITH + 2.1.4 diff --git a/nixpkgs/pkgs/tools/backup/lvmsync/default.nix b/nixpkgs/pkgs/tools/backup/lvmsync/default.nix new file mode 100644 index 000000000000..00a03cda7149 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/lvmsync/default.nix @@ -0,0 +1,34 @@ +{ lib, stdenv, bundlerEnv, ruby, bundlerUpdateScript, makeWrapper }: + +stdenv.mkDerivation rec { + pname = "lvmsync"; + version = (import ./gemset.nix).${pname}.version; + + nativeBuildInputs = [ makeWrapper ]; + + dontUnpack = true; + + installPhase = let + env = bundlerEnv { + name = "${pname}-${version}-gems"; + ruby = ruby; + gemfile = ./Gemfile; + lockfile = ./Gemfile.lock; + gemset = ./gemset.nix; + }; + in '' + mkdir -p $out/bin + makeWrapper ${env}/bin/lvmsync $out/bin/lvmsync + ''; + + passthru.updateScript = bundlerUpdateScript "lvmsync"; + + meta = with lib; { + description = "Optimised synchronisation of LVM snapshots over a network"; + homepage = "https://theshed.hezmatt.org/lvmsync/"; + license = licenses.gpl3; + platforms = platforms.all; + maintainers = with maintainers; [ jluttine nicknovitski ]; + }; + +} diff --git a/nixpkgs/pkgs/tools/backup/lvmsync/gemset.nix b/nixpkgs/pkgs/tools/backup/lvmsync/gemset.nix new file mode 100644 index 000000000000..f17aa513a1f3 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/lvmsync/gemset.nix @@ -0,0 +1,36 @@ +{ + git-version-bump = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0xcj20gmbpqn2gcpid4pxpnimfdg2ip9jnl1572naz0magcrwl2s"; + type = "gem"; + }; + version = "0.15.1"; + }; + lvmsync = { + dependencies = ["git-version-bump" "treetop"]; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "02mdrvfibvab4p4yrdzxvndhy8drss3ri7izybcwgpbyc7isk8mv"; + type = "gem"; + }; + version = "3.3.2"; + }; + polyglot = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "1bqnxwyip623d8pr29rg6m8r0hdg08fpr2yb74f46rn1wgsnxmjr"; + type = "gem"; + }; + version = "0.3.5"; + }; + treetop = { + dependencies = ["polyglot"]; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0sdkd1v2h8dhj9ncsnpywmqv7w1mdwsyc5jwyxlxwriacv8qz8bd"; + type = "gem"; + }; + version = "1.6.9"; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/mastodon-archive/default.nix b/nixpkgs/pkgs/tools/backup/mastodon-archive/default.nix new file mode 100644 index 000000000000..88d05022d437 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/mastodon-archive/default.nix @@ -0,0 +1,32 @@ +{ lib +, fetchFromGitHub +, python3 +}: + +python3.pkgs.buildPythonApplication rec { + pname = "mastodon-archive"; + version = "1.4.2"; + + src = fetchFromGitHub { + owner = "kensanata"; + repo = "mastodon-backup"; + rev = "v${version}"; + hash = "sha256-b4bYQshz7mwxEfpRYV7ze4C8hz58R9cVp58wHvGFb0A="; + }; + + propagatedBuildInputs = with python3.pkgs; [ + html2text + mastodon-py + progress + ]; + + # There is no test + doCheck = false; + + meta = with lib; { + description = "Utility for backing up your Mastodon content"; + homepage = "https://alexschroeder.ch/software/Mastodon_Archive"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ julm ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/monolith/default.nix b/nixpkgs/pkgs/tools/backup/monolith/default.nix new file mode 100644 index 000000000000..10859512ef80 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/monolith/default.nix @@ -0,0 +1,36 @@ +{ lib, stdenv +, rustPlatform +, fetchFromGitHub +, pkg-config +, openssl +, libiconv +, Security +, SystemConfiguration +}: + +rustPlatform.buildRustPackage rec { + pname = "monolith"; + version = "2.8.1"; + + src = fetchFromGitHub { + owner = "Y2Z"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-qMB4Tok0tYAqj8r9LEkjhBV5ko+hwagFS7MsL8AYJnc="; + }; + + cargoHash = "sha256-FeD0+s79orFDUVsb205W0pdXgDI+p1UrH3GIfKwUqDQ="; + + nativeBuildInputs = lib.optionals stdenv.isLinux [ pkg-config ]; + buildInputs = lib.optionals stdenv.isLinux [ openssl ] + ++ lib.optionals stdenv.isDarwin [ libiconv Security SystemConfiguration ]; + + checkFlagsArray = [ "--skip=tests::cli" ]; + + meta = with lib; { + description = "Bundle any web page into a single HTML file"; + homepage = "https://github.com/Y2Z/monolith"; + license = licenses.unlicense; + maintainers = with maintainers; [ Br1ght0ne ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/mt-st/default.nix b/nixpkgs/pkgs/tools/backup/mt-st/default.nix new file mode 100644 index 000000000000..8c62ad6512e0 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/mt-st/default.nix @@ -0,0 +1,24 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + pname = "mt-st"; + version = "1.3"; + + src = fetchurl { + url = "https://github.com/iustin/mt-st/releases/download/mt-st-${version}/mt-st-${version}.tar.gz"; + sha256 = "b552775326a327cdcc076c431c5cbc4f4e235ac7c41aa931ad83f94cccb9f6de"; + }; + + installFlags = [ "PREFIX=$(out)" "EXEC_PREFIX=$(out)" ]; + + meta = { + description = "Magnetic Tape control tools for Linux"; + longDescription = '' + Fork of the standard "mt" tool with additional Linux-specific IOCTLs. + ''; + homepage = "https://github.com/iustin/mt-st"; + license = lib.licenses.gpl2; + maintainers = [ lib.maintainers.redvers ]; + platforms = lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/mtx/default.nix b/nixpkgs/pkgs/tools/backup/mtx/default.nix new file mode 100644 index 000000000000..683bee11067d --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/mtx/default.nix @@ -0,0 +1,28 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + pname = "mtx"; + version = "1.3.12"; + + src = fetchurl { + url = "mirror://sourceforge/${pname}/${pname}-stable/${version}/${pname}-${version}.tar.gz"; + sha256 = "0261c5e90b98b6138cd23dadecbc7bc6e2830235145ed2740290e1f35672d843"; + }; + + doCheck = false; + + meta = { + description = "Media Changer Tools"; + longDescription = '' + The mtx command controls single or multi-drive SCSI media changers such as + tape changers, autoloaders, tape libraries, or optical media jukeboxes. It + can also be used with media changers that use the 'ATTACHED' API, presuming + that they properly report the MChanger bit as required by the SCSI T-10 SMC + specification. + ''; + homepage = "https://sourceforge.net/projects/mtx/"; + license = lib.licenses.gpl2; + maintainers = [ lib.maintainers.redvers ]; + platforms = lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/mydumper/default.nix b/nixpkgs/pkgs/tools/backup/mydumper/default.nix new file mode 100644 index 000000000000..bde0306a6acb --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/mydumper/default.nix @@ -0,0 +1,43 @@ +{ lib, stdenv, fetchFromGitHub +, cmake, pkg-config, sphinx +, glib , pcre +, libmysqlclient, libressl +, zlib, zstd +}: + +stdenv.mkDerivation rec { + pname = "mydumper"; + version = "0.14.3-1"; + + src = fetchFromGitHub { + owner = "mydumper"; + repo = "mydumper"; + rev = "refs/tags/v${version}"; + hash = "sha256-qyJGnrBOElQ3s2VoOWfW1luacd33haanmzKidMBgCpc="; + }; + + outputs = [ "out" "doc" "man" ]; + + nativeBuildInputs = [ cmake pkg-config sphinx ]; + + buildInputs = [ + glib pcre + libmysqlclient libressl + zlib zstd + ]; + + cmakeFlags = [ + "-DCMAKE_SKIP_BUILD_RPATH=ON" + "-DMYSQL_INCLUDE_DIR=${lib.getDev libmysqlclient}/include/mysql" + "-DWITH_ZSTD=ON" + ]; + + meta = with lib; { + description = "High-performance MySQL backup tool"; + homepage = "https://github.com/maxbube/mydumper"; + changelog = "https://github.com/mydumper/mydumper/releases/tag/v${version}"; + license = licenses.gpl3Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ izorkin ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/mylvmbackup/default.nix b/nixpkgs/pkgs/tools/backup/mylvmbackup/default.nix new file mode 100644 index 000000000000..6c87fca05672 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/mylvmbackup/default.nix @@ -0,0 +1,50 @@ +{ lib +, stdenv +, fetchurl +, perlPackages +, makeWrapper +}: + +stdenv.mkDerivation rec { + pname = "mylvmbackup"; + version = "0.16"; + + src = fetchurl { + url = "https://www.lenzg.net/mylvmbackup/${pname}-${version}.tar.gz"; + sha256 = "sha256-vb7M3EPIrxIz6jUwm241fzaEz2czqdCObrFgSOSgJRU="; + }; + + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ perlPackages.perl ]; + + dontConfigure = true; + + postPatch = '' + patchShebangs mylvmbackup + substituteInPlace Makefile \ + --replace "prefix = /usr/local" "prefix = ${builtins.placeholder "out"}" \ + --replace "sysconfdir = /etc" "sysconfdir = ${builtins.placeholder "out"}/etc" \ + --replace "/usr/bin/install" "install" + ''; + + postInstall = '' + wrapProgram "$out/bin/mylvmbackup" \ + --prefix PERL5LIB : "${perlPackages.makePerlPath ( + with perlPackages; [ + ConfigIniFiles + DBDmysql + DBI + TimeDate + FileCopyRecursive + ] + )}" + ''; + + meta = { + homepage = "https://www.lenzg.net/mylvmbackup/"; + description = "a tool for quickly creating full physical backups of a MySQL server's data files"; + license = lib.licenses.gpl2Only; + maintainers = with lib.maintainers; [ ryantm ]; + platforms = with lib.platforms; linux; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/partclone/default.nix b/nixpkgs/pkgs/tools/backup/partclone/default.nix new file mode 100644 index 000000000000..a1f9365be809 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/partclone/default.nix @@ -0,0 +1,50 @@ +{ lib, stdenv, fetchFromGitHub, autoreconfHook +, pkg-config, libuuid, e2fsprogs, nilfs-utils, ntfs3g, openssl +}: + +stdenv.mkDerivation rec { + pname = "partclone"; + version = "0.3.27"; + + src = fetchFromGitHub { + owner = "Thomas-Tsai"; + repo = "partclone"; + rev = version; + sha256 = "sha256-atQ355w9BRUJKkvuyJupcNexVEnVcYsWRvnNmpBw8OA="; + }; + + nativeBuildInputs = [ autoreconfHook pkg-config ]; + buildInputs = [ + e2fsprogs libuuid stdenv.cc.libc nilfs-utils ntfs3g openssl + (lib.getOutput "static" stdenv.cc.libc) + ]; + + configureFlags = [ + "--enable-xfs" + "--enable-extfs" + "--enable-hfsp" + "--enable-fat" + "--enable-exfat" + "--enable-ntfs" + "--enable-btrfs" + "--enable-minix" + "--enable-f2fs" + "--enable-nilfs2" + ]; + + enableParallelBuilding = true; + + meta = with lib; { + description = "Utilities to save and restore used blocks on a partition"; + longDescription = '' + Partclone provides utilities to save and restore used blocks on a + partition and is designed for higher compatibility of the file system by + using existing libraries, e.g. e2fslibs is used to read and write the + ext2 partition. + ''; + homepage = "https://partclone.org"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ marcweber ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/partimage/default.nix b/nixpkgs/pkgs/tools/backup/partimage/default.nix new file mode 100644 index 000000000000..7a8210566129 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/partimage/default.nix @@ -0,0 +1,50 @@ +{lib, stdenv +, fetchurl +, fetchpatch +, bzip2 +, zlib +, newt +, openssl +, pkg-config +, slang +, libxcrypt +, autoreconfHook +}: +stdenv.mkDerivation rec { + pname = "partimage"; + version = "0.6.9"; + + enableParallelBuilding = true; + + src = fetchurl { + url = "mirror://sourceforge/partimage/partimage-${version}.tar.bz2"; + sha256 = "0db6xiphk6xnlpbxraiy31c5xzj0ql6k4rfkmqzh665yyj0nqfkm"; + }; + + configureFlags = [ "--with-ssl-headers=${openssl.dev}/include/openssl" ]; + + nativeBuildInputs = [ pkg-config autoreconfHook ]; + buildInputs = [ bzip2 zlib newt newt openssl slang libxcrypt ]; + + patches = [ + ./gentoos-zlib.patch + (fetchpatch { + name = "openssl-1.1.patch"; + url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-block/partimage/files/" + + "partimage-0.6.9-openssl-1.1-compatibility.patch?id=3fe8e9910002b6523d995512a646b063565d0447"; + sha256 = "1hs0krxrncxq1w36bhad02yk8yx71zcfs35cw87c82sl2sfwasjg"; + }) + (fetchpatch { + url = "https://sources.debian.org/data/main/p/partimage/0.6.9-8/debian/patches/04-fix-FTBFS-glic-2.28.patch"; + sha256 = "0xid5636g58sxbhxnjmfjdy7y8rf3c77zmmpfbbqv4lv9jd2gmxm"; + }) + ]; + + meta = { + description = "Opensource disk backup software"; + homepage = "https://www.partimage.org"; + license = lib.licenses.gpl2; + maintainers = [lib.maintainers.marcweber]; + platforms = lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/partimage/gentoos-zlib.patch b/nixpkgs/pkgs/tools/backup/partimage/gentoos-zlib.patch new file mode 100644 index 000000000000..05150e131e36 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/partimage/gentoos-zlib.patch @@ -0,0 +1,33 @@ +http://bugs.gentoo.org/405323 + +--- a/src/client/imagefile.cpp ++++ b/src/client/imagefile.cpp +@@ -783,7 +783,7 @@ + else if (m_options.dwCompression == COMPRESS_GZIP) // Gzip compression + { + showDebug(1, "open gzip\n"); +- m_gzImageFile = (gzFile *) gzdopen(m_nFdImage, "wb"); //"wb1h"); ++ m_gzImageFile = gzdopen(m_nFdImage, "wb"); //"wb1h"); + if (m_gzImageFile == NULL) + { + showDebug(1, "error:%d %s\n", errno, strerror(errno)); +@@ -1098,7 +1098,7 @@ + } + else if (m_options.dwCompression == COMPRESS_GZIP) // Gzip compression + { +- m_gzImageFile = (gzFile *) gzdopen(m_nFdImage, "rb"); ++ m_gzImageFile = gzdopen(m_nFdImage, "rb"); + if (m_gzImageFile == NULL) + THROW(ERR_ERRNO, errno); + else +--- a/src/client/imagefile.h ++++ b/src/client/imagefile.h +@@ -41,7 +41,7 @@ + COptions m_options; + + FILE *m_fImageFile; +- gzFile *m_gzImageFile; ++ gzFile m_gzImageFile; + BZFILE *m_bzImageFile; + + int m_nFdImage; diff --git a/nixpkgs/pkgs/tools/backup/percona-xtrabackup/8_0.nix b/nixpkgs/pkgs/tools/backup/percona-xtrabackup/8_0.nix new file mode 100644 index 000000000000..fbb4c045d776 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/percona-xtrabackup/8_0.nix @@ -0,0 +1,17 @@ +{ callPackage, ... } @ args: + +callPackage ./generic.nix (args // { + version = "8.0.35-30"; + hash = "sha256-yagqBKU057Gk5pEyT2R3c5DtxNG/+TSPenFgbxUiHPo="; + + # includes https://github.com/Percona-Lab/libkmip.git + fetchSubmodules = true; + + extraPatches = [ + ./abi-check.patch + ]; + + extraPostInstall = '' + rm -r "$out"/docs + ''; +}) diff --git a/nixpkgs/pkgs/tools/backup/percona-xtrabackup/abi-check.patch b/nixpkgs/pkgs/tools/backup/percona-xtrabackup/abi-check.patch new file mode 100644 index 000000000000..53442ef5bc00 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/percona-xtrabackup/abi-check.patch @@ -0,0 +1,18 @@ +MySQL ABI check assumes that with -nostdinc any standard #include terminates +preprocessing, but we do not provide that: +https://github.com/NixOS/nixpkgs/issues/44530 + +"#error" does not terminate preprocessing, so we #include a non-existent file instead. + +--- a/cmake/do_abi_check.cmake ++++ b/cmake/do_abi_check.cmake +@@ -68,1 +68,1 @@ FOREACH(file ${ABI_HEADERS}) +- -E -nostdinc -dI -DMYSQL_ABI_CHECK -I${ABI_SOURCE_DIR}/include ++ -E -nostdinc -dI -DMYSQL_ABI_CHECK -I${ABI_SOURCE_DIR}/include/nostdinc -I${ABI_SOURCE_DIR}/include +@@ -74,1 +74,1 @@ FOREACH(file ${ABI_HEADERS}) +- COMMAND ${WSL_EXECUTABLE} sed -e "/^# /d" ++ COMMAND ${WSL_EXECUTABLE} sed -e "/^# /d" -e "/^#include <-nostdinc>$/d" +--- /dev/null ++++ b/include/nostdinc/stdint.h +@@ -0,0 +1,1 @@ ++#include <-nostdinc> diff --git a/nixpkgs/pkgs/tools/backup/percona-xtrabackup/generic.nix b/nixpkgs/pkgs/tools/backup/percona-xtrabackup/generic.nix new file mode 100644 index 000000000000..112a3f556204 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/percona-xtrabackup/generic.nix @@ -0,0 +1,57 @@ +{ lib, stdenv, fetchFromGitHub, bison, boost, cmake, makeWrapper, pkg-config +, curl, cyrus_sasl, libaio, libedit, libev, libevent, libgcrypt, libgpg-error, lz4 +, ncurses, numactl, openssl, procps, protobuf, valgrind, xxd, zlib +, perlPackages +, version, hash, fetchSubmodules ? false, extraPatches ? [], extraPostInstall ? "", ... +}: + +stdenv.mkDerivation rec { + pname = "percona-xtrabackup"; + inherit version; + + src = fetchFromGitHub { + owner = "percona"; + repo = "percona-xtrabackup"; + rev = "${pname}-${version}"; + inherit hash fetchSubmodules; + }; + + nativeBuildInputs = [ bison boost cmake makeWrapper pkg-config ]; + + buildInputs = [ + (curl.override { inherit openssl; }) cyrus_sasl libaio libedit libevent libev libgcrypt libgpg-error lz4 + ncurses numactl openssl procps protobuf valgrind xxd zlib + ] ++ (with perlPackages; [ perl DBI DBDmysql ]); + + patches = extraPatches; + + cmakeFlags = [ + "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock" + "-DBUILD_CONFIG=xtrabackup_release" + "-DINSTALL_MYSQLTESTDIR=OFF" + "-DWITH_BOOST=system" + "-DWITH_CURL=system" + "-DWITH_EDITLINE=system" + "-DWITH_LIBEVENT=system" + "-DWITH_LZ4=system" + "-DWITH_PROTOBUF=system" + "-DWITH_SASL=system" + "-DWITH_SSL=system" + "-DWITH_ZLIB=system" + "-DWITH_VALGRIND=ON" + "-DWITH_MAN_PAGES=OFF" + ]; + + postInstall = '' + wrapProgram "$out"/bin/xtrabackup --prefix PERL5LIB : $PERL5LIB + rm -r "$out"/lib/plugin/debug + '' + extraPostInstall; + + meta = with lib; { + description = "Non-blocking backup tool for MySQL"; + homepage = "http://www.percona.com/software/percona-xtrabackup"; + license = licenses.lgpl2; + platforms = platforms.linux; + maintainers = teams.flyingcircus.members ++ [ maintainers.izorkin ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/pgbackrest/default.nix b/nixpkgs/pkgs/tools/backup/pgbackrest/default.nix new file mode 100644 index 000000000000..a2c727332554 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/pgbackrest/default.nix @@ -0,0 +1,40 @@ +{ lib +, stdenv +, fetchFromGitHub +, pkg-config +, postgresql +, openssl +, lz4 +, bzip2 +, libxml2 +, zlib +, zstd +, libyaml +}: +stdenv.mkDerivation rec { + pname = "pgbackrest"; + version = "2.50"; + + src = fetchFromGitHub { + owner = "pgbackrest"; + repo = "pgbackrest"; + rev = "release/${version}"; + sha256 = "sha256-RjkTg80LAUndSVfTrol9hvgNOG6PMC+OkMVjdtjpdbI="; + }; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ postgresql openssl lz4 bzip2 libxml2 zlib zstd libyaml ]; + + postUnpack = '' + sourceRoot+=/src + ''; + + meta = with lib; { + description = "Reliable PostgreSQL backup & restore"; + homepage = "https://pgbackrest.org/"; + changelog = "https://github.com/pgbackrest/pgbackrest/releases"; + license = licenses.mit; + mainProgram = "pgbackrest"; + maintainers = with maintainers; [ zaninime ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/pyznap/default.nix b/nixpkgs/pkgs/tools/backup/pyznap/default.nix new file mode 100644 index 000000000000..81f3a99ecd91 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/pyznap/default.nix @@ -0,0 +1,29 @@ +{ lib +, buildPythonApplication +, fetchPypi +, setuptools +}: + +buildPythonApplication rec { + pname = "pyznap"; + version = "1.6.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "88bf1d6de2c11f14acbdfa01b61eb95c94f95d829ddebdaee3786b64ccb93ae3"; + }; + + propagatedBuildInputs = [ + setuptools + ]; + + # tests aren't included in the PyPI packages + doCheck = false; + + meta = { + homepage = "https://github.com/yboetz/pyznap"; + description = "ZFS snapshot tool written in python"; + license = with lib.licenses; [ gpl3 ]; + maintainers = with lib.maintainers; [ rbrewer ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/rdedup/default.nix b/nixpkgs/pkgs/tools/backup/rdedup/default.nix new file mode 100644 index 000000000000..c9b59782a585 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/rdedup/default.nix @@ -0,0 +1,28 @@ +{ lib, stdenv, fetchFromGitHub, rustPlatform, pkg-config, openssl, libsodium +, xz +, Security }: + +rustPlatform.buildRustPackage rec { + pname = "rdedup"; + version = "3.2.1"; + + src = fetchFromGitHub { + owner = "dpc"; + repo = "rdedup"; + rev = "v${version}"; + sha256 = "sha256-GEYP18CaCQShvCg8T7YTvlybH1LNO34KBxgmsTv2Lzs="; + }; + + cargoSha256 = "sha256-I6d3IyPBcUsrvlzF7W0hFM4hcXi4wWro9bCeP4eArHI="; + + nativeBuildInputs = [ pkg-config rustPlatform.bindgenHook ]; + buildInputs = [ openssl libsodium xz ] + ++ (lib.optional stdenv.isDarwin Security); + + meta = with lib; { + description = "Data deduplication with compression and public key encryption"; + homepage = "https://github.com/dpc/rdedup"; + license = licenses.mpl20; + maintainers = with maintainers; [ dywedir ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/rdiff-backup/default.nix b/nixpkgs/pkgs/tools/backup/rdiff-backup/default.nix new file mode 100644 index 000000000000..58605362f065 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/rdiff-backup/default.nix @@ -0,0 +1,32 @@ +{ lib, python3Packages, fetchPypi, librsync }: + +let + pypkgs = python3Packages; + +in +pypkgs.buildPythonApplication rec { + pname = "rdiff-backup"; + version = "2.2.6"; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-0HeDVyZrxlE7t/daRXCymySydgNIu/YHur/DpvCUWM8"; + }; + + nativeBuildInputs = with pypkgs; [ setuptools-scm ]; + + buildInputs = [ librsync ]; + + propagatedBuildInputs = with pypkgs; [ pyyaml ]; + + # no tests from pypi + doCheck = false; + + meta = with lib; { + description = "Backup system trying to combine best a mirror and an incremental backup system"; + homepage = "https://rdiff-backup.net"; + license = licenses.gpl2Only; + maintainers = with maintainers; [ peterhoeg ]; + platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/rdup/default.nix b/nixpkgs/pkgs/tools/backup/rdup/default.nix new file mode 100644 index 000000000000..f75285e9ef97 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/rdup/default.nix @@ -0,0 +1,24 @@ +{ lib, stdenv, fetchFromGitHub, pkg-config, autoreconfHook, glib, pcre }: + +stdenv.mkDerivation { + pname = "rdup"; + version = "1.1.15"; + + src = fetchFromGitHub { + owner = "miekg"; + repo = "rdup"; + rev = "d66e4320cd0bbcc83253baddafe87f9e0e83caa6"; + sha256 = "0bzyv6qmnivxnv9nw7lnfn46k0m1dlxcjj53zcva6v8y8084l1iw"; + }; + + nativeBuildInputs = [ autoreconfHook pkg-config ]; + buildInputs = [ glib pcre ]; + + meta = { + description = "The only backup program that doesn't make backups"; + homepage = "https://github.com/miekg/rdup"; + license = lib.licenses.gpl3; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ sternenseemann ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/restic/0001-Skip-testing-restore-with-permission-failure.patch b/nixpkgs/pkgs/tools/backup/restic/0001-Skip-testing-restore-with-permission-failure.patch new file mode 100644 index 000000000000..10664b57254c --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/restic/0001-Skip-testing-restore-with-permission-failure.patch @@ -0,0 +1,25 @@ +From 72f7d8abee34107b815e49540f2fad7f1ab0b2cc Mon Sep 17 00:00:00 2001 +From: Simon Bruder <simon@sbruder.de> +Date: Thu, 25 Feb 2021 09:20:51 +0100 +Subject: [PATCH] Skip testing restore with permission failure + +The test fails in sandboxed builds. +--- + cmd/restic/cmd_restore_integration_test.go | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/cmd/restic/cmd_restore_integration_test.go b/cmd/restic/cmd_restore_integration_test.go +index 2c7cbe1fb..f25f13754 100644 +--- a/cmd/restic/cmd_restore_integration_test.go ++++ b/cmd/restic/cmd_restore_integration_test.go +@@ -200,6 +200,7 @@ func TestRestoreLatest(t *testing.T) { + } + + func TestRestoreWithPermissionFailure(t *testing.T) { ++ t.Skip("Skipping testing restore with permission failure") + env, cleanup := withTestEnvironment(t) + defer cleanup() + +-- +2.41.0 + diff --git a/nixpkgs/pkgs/tools/backup/restic/default.nix b/nixpkgs/pkgs/tools/backup/restic/default.nix new file mode 100644 index 000000000000..ad70b31a2a0a --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/restic/default.nix @@ -0,0 +1,53 @@ +{ stdenv, lib, buildGoModule, fetchFromGitHub, installShellFiles, makeWrapper +, nixosTests, rclone }: + +buildGoModule rec { + pname = "restic"; + version = "0.16.4"; + + src = fetchFromGitHub { + owner = "restic"; + repo = "restic"; + rev = "v${version}"; + hash = "sha256-TSUhrtSgGIPM/cUzA6WDtCpqCyjtnM5BZDhK6udR0Ek="; + }; + + patches = [ + # The TestRestoreWithPermissionFailure test fails in Nix’s build sandbox + ./0001-Skip-testing-restore-with-permission-failure.patch + ]; + + vendorHash = "sha256-E+Erf8AdlMBdep1g2SpI8JKIdJuKqmyWEUmh8Rs5R/o="; + + subPackages = [ "cmd/restic" ]; + + nativeBuildInputs = [ installShellFiles makeWrapper ]; + + passthru.tests.restic = nixosTests.restic; + + postPatch = '' + rm cmd/restic/cmd_mount_integration_test.go + ''; + + postInstall = '' + wrapProgram $out/bin/restic --prefix PATH : '${rclone}/bin' + '' + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + $out/bin/restic generate \ + --bash-completion restic.bash \ + --fish-completion restic.fish \ + --zsh-completion restic.zsh \ + --man . + installShellCompletion restic.{bash,fish,zsh} + installManPage *.1 + ''; + + meta = with lib; { + homepage = "https://restic.net"; + changelog = "https://github.com/restic/restic/blob/${src.rev}/CHANGELOG.md"; + description = "A backup program that is fast, efficient and secure"; + platforms = platforms.linux ++ platforms.darwin; + license = licenses.bsd2; + maintainers = [ maintainers.mbrgm maintainers.dotlambda ]; + mainProgram = "restic"; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/restic/rest-server.nix b/nixpkgs/pkgs/tools/backup/restic/rest-server.nix new file mode 100644 index 000000000000..9af1151518b6 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/restic/rest-server.nix @@ -0,0 +1,23 @@ +{ lib, buildGoModule, fetchFromGitHub }: + +buildGoModule rec { + pname = "restic-rest-server"; + version = "0.12.1"; + + src = fetchFromGitHub { + owner = "restic"; + repo = "rest-server"; + rev = "v${version}"; + hash = "sha256-0zmUI7LUKVXUdPsNxY7RQxbsAraY0GrTMAS3kORIU6I="; + }; + + vendorHash = "sha256-tD5ffIYULMBqu99l1xCL0RnLB9zNpwNPs1qVFqezUc8="; + + meta = with lib; { + changelog = "https://github.com/restic/rest-server/blob/${src.rev}/CHANGELOG.md"; + description = "A high performance HTTP server that implements restic's REST backend API"; + homepage = "https://github.com/restic/rest-server"; + license = licenses.bsd2; + maintainers = with maintainers; [ dotlambda ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/rotate-backups/default.nix b/nixpkgs/pkgs/tools/backup/rotate-backups/default.nix new file mode 100644 index 000000000000..d64b0dee50a8 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/rotate-backups/default.nix @@ -0,0 +1,38 @@ +{ lib +, python3 +, fetchFromGitHub +}: + +python3.pkgs.buildPythonApplication rec { + pname = "rotate-backups"; + version = "8.1"; + + src = fetchFromGitHub { + owner = "xolox"; + repo = "python-rotate-backups"; + rev = version; + sha256 = "0r4dyd7hj403rksgp3vh1azp9n4af75r3wq3x39wxcqizpms3vkx"; + }; + + propagatedBuildInputs = with python3.pkgs; [ + python-dateutil + simpleeval + update-dotdee + ]; + + nativeCheckInputs = with python3.pkgs; [ + pytestCheckHook + ]; + + disabledTests = [ + # https://github.com/xolox/python-rotate-backups/issues/33 + "test_removal_command" + ]; + + meta = with lib; { + description = "Simple command line interface for backup rotation"; + homepage = "https://github.com/xolox/python-rotate-backups"; + license = licenses.mit; + maintainers = with maintainers; [ eyjhb ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/rsbep/default.nix b/nixpkgs/pkgs/tools/backup/rsbep/default.nix new file mode 100644 index 000000000000..b30ddddb2b07 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/rsbep/default.nix @@ -0,0 +1,46 @@ +{ lib, stdenv, coreutils, gawk, fetchFromGitHub }: + +stdenv.mkDerivation rec { + pname = "rsbep"; + version = "0.2.0"; + + src = fetchFromGitHub { + owner = "ttsiodras"; + repo = "rsbep-backup"; + rev = "v${version}"; + sha256 = "0is4jgil3wdqbvx9h66xcyzbqy84ndyydnnay2g9k81a4mcz4dns"; + }; + + postFixup = '' + cd $out/bin + + # Move internal tool 'rsbep_chopper' to libexec + libexecDir=$out/libexec/rsbep + mkdir -p $libexecDir + mv rsbep_chopper $libexecDir + + # Fix store dependencies in scripts + path="export PATH=$out/bin:$libexecDir:${lib.makeBinPath [ coreutils gawk ]}" + sed -i "2i$path" freeze.sh + sed -i "2i$path" melt.sh + + # Remove unneded binary + rm poorZFS.py + ''; + + doInstallCheck = true; + installCheckPhase = '' + cd $TMP + echo hello > input + $out/bin/freeze.sh input > packed + $out/bin/melt.sh packed > output + diff -u input output + ''; + + meta = with lib; { + description = "Create resilient backups with Reed-Solomon error correction and byte-spreading"; + homepage = "https://www.thanassis.space/rsbep.html"; + license = licenses.gpl3Plus; + maintainers = [ maintainers.erikarvstedt ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/rsnapshot/default.nix b/nixpkgs/pkgs/tools/backup/rsnapshot/default.nix new file mode 100644 index 000000000000..57883c4f68e4 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/rsnapshot/default.nix @@ -0,0 +1,28 @@ +{ fetchurl, lib, stdenv, perl, openssh, rsync, logger }: + +stdenv.mkDerivation rec { + pname = "rsnapshot"; + version = "1.4.5"; + + src = fetchurl { + url = "https://rsnapshot.org/downloads/rsnapshot-${version}.tar.gz"; + sha256 = "sha256-ELdeAcolUR6CZqrNSVUxl1rRqK1VYha2pXx20CizgkI="; + }; + + propagatedBuildInputs = [perl openssh rsync logger]; + + configureFlags = [ "--sysconfdir=/etc --prefix=/" ]; + makeFlags = [ "DESTDIR=$(out)" ]; + + patchPhase = '' + substituteInPlace "Makefile.in" --replace \ + "/usr/bin/pod2man" "${perl}/bin/pod2man" + ''; + + meta = with lib; { + description = "A filesystem snapshot utility for making backups of local and remote systems"; + homepage = "https://rsnapshot.org/"; + license = lib.licenses.gpl2Plus; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/rustic-rs/default.nix b/nixpkgs/pkgs/tools/backup/rustic-rs/default.nix new file mode 100644 index 000000000000..b5cae0b17c68 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/rustic-rs/default.nix @@ -0,0 +1,54 @@ +{ lib +, fetchFromGitHub +, rustPlatform +, stdenv +, Security +, SystemConfiguration +, installShellFiles +, nix-update-script +}: + +rustPlatform.buildRustPackage rec { + pname = "rustic-rs"; + version = "0.7.0"; + + src = fetchFromGitHub { + owner = "rustic-rs"; + repo = "rustic"; + rev = "refs/tags/v${version}"; + hash = "sha256-jUAmboJTzX4oJZy9rFiPRbm94bVpZGa0SaqotoCU/Ss="; + }; + + cargoHash = "sha256-iZuWlYDGGziwb49BfKdt9Ahs6oQ0Ij2iiT0tvL7ZIVk="; + + # At the time of writing, upstream defaults to "self-update" and "webdav". + # "self-update" is a self-updater, which we don't want in nixpkgs. + buildNoDefaultFeatures = true; + buildFeatures = [ + "webdav" + ]; + + nativeBuildInputs = [ installShellFiles ]; + + buildInputs = lib.optionals stdenv.isDarwin [ Security SystemConfiguration ]; + + postInstall = '' + for shell in {ba,fi,z}sh; do + $out/bin/rustic completions $shell > rustic.$shell + done + + installShellCompletion rustic.{ba,fi,z}sh + ''; + + passthru.updateScript = nix-update-script { }; + + meta = { + homepage = "https://github.com/rustic-rs/rustic"; + changelog = "https://github.com/rustic-rs/rustic/blob/${src.rev}/CHANGELOG.md"; + description = "fast, encrypted, deduplicated backups powered by pure Rust"; + mainProgram = "rustic"; + platforms = lib.platforms.linux ++ lib.platforms.darwin; + license = [ lib.licenses.mit lib.licenses.asl20 ]; + maintainers = [ lib.maintainers.nobbz ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/s3ql/default.nix b/nixpkgs/pkgs/tools/backup/s3ql/default.nix new file mode 100644 index 000000000000..e2e68109b801 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/s3ql/default.nix @@ -0,0 +1,37 @@ +{ lib, fetchFromGitHub, python3Packages, sqlite, which }: + +python3Packages.buildPythonApplication rec { + pname = "s3ql"; + version = "4.0.0"; + + src = fetchFromGitHub { + owner = pname; + repo = pname; + rev = "refs/tags/release-${version}"; + sha256 = "sha256-7N09b7JwMPliuyv2fEy1gQYaFCMSSvajOBPhNL3DQsg="; + }; + + nativeCheckInputs = [ which ] ++ (with python3Packages; [ cython pytest pytest-trio ]); + propagatedBuildInputs = with python3Packages; [ + sqlite apsw pycrypto requests defusedxml dugong + google-auth google-auth-oauthlib trio pyfuse3 + ]; + + preBuild = '' + ${python3Packages.python.pythonOnBuildForHost.interpreter} ./setup.py build_cython build_ext --inplace + ''; + + checkPhase = '' + # Removing integration tests + rm tests/t{4,5,6}_* + pytest tests + ''; + + meta = with lib; { + description = "A full-featured file system for online data storage"; + homepage = "https://github.com/s3ql/s3ql/"; + license = licenses.gpl3; + maintainers = with maintainers; [ rushmorem ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/sanoid/default.nix b/nixpkgs/pkgs/tools/backup/sanoid/default.nix new file mode 100644 index 000000000000..f37a47149067 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/sanoid/default.nix @@ -0,0 +1,56 @@ +{ lib, stdenv, fetchFromGitHub, nixosTests, makeWrapper, zfs +, perlPackages, procps, which, openssh, mbuffer, pv, lzop, gzip, pigz }: + +stdenv.mkDerivation rec { + pname = "sanoid"; + version = "2.2.0"; + + src = fetchFromGitHub { + owner = "jimsalterjrs"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-qfRGZ10fhLL4tJL97VHrdOkO/4OVpa087AsL9t8LMmk="; + }; + + nativeBuildInputs = [ makeWrapper ]; + buildInputs = with perlPackages; [ perl ConfigIniFiles CaptureTiny ]; + + passthru.tests = nixosTests.sanoid; + + installPhase = '' + runHook preInstall + + mkdir -p "$out/bin" + mkdir -p "$out/etc/sanoid" + cp sanoid.defaults.conf "$out/etc/sanoid/sanoid.defaults.conf" + # Hardcode path to default config + substitute sanoid "$out/bin/sanoid" \ + --replace "\$args{'configdir'}/sanoid.defaults.conf" "$out/etc/sanoid/sanoid.defaults.conf" + chmod +x "$out/bin/sanoid" + # Prefer ZFS userspace tools from /run/booted-system/sw/bin to avoid + # incompatibilities with the ZFS kernel module. + wrapProgram "$out/bin/sanoid" \ + --prefix PERL5LIB : "$PERL5LIB" \ + --prefix PATH : "${lib.makeBinPath [ procps "/run/booted-system/sw" zfs ]}" + + install -m755 syncoid "$out/bin/syncoid" + wrapProgram "$out/bin/syncoid" \ + --prefix PERL5LIB : "$PERL5LIB" \ + --prefix PATH : "${lib.makeBinPath [ openssh procps which pv mbuffer lzop gzip pigz "/run/booted-system/sw" zfs ]}" + + install -m755 findoid "$out/bin/findoid" + wrapProgram "$out/bin/findoid" \ + --prefix PERL5LIB : "$PERL5LIB" \ + --prefix PATH : "${lib.makeBinPath [ "/run/booted-system/sw" zfs ]}" + + runHook postInstall + ''; + + meta = with lib; { + description = "A policy-driven snapshot management tool for ZFS filesystems"; + homepage = "https://github.com/jimsalterjrs/sanoid"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ lopsided98 Frostman ]; + platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/sigtop/default.nix b/nixpkgs/pkgs/tools/backup/sigtop/default.nix new file mode 100644 index 000000000000..b83dd061efe4 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/sigtop/default.nix @@ -0,0 +1,26 @@ +{ lib, buildGoModule, fetchFromGitHub }: + +buildGoModule rec { + name = "sigtop"; + version = "0.10.0"; + + src = fetchFromGitHub { + owner = "tbvdm"; + repo = "sigtop"; + rev = "v${version}"; + sha256 = "sha256-I1gZpzs7GtoS+EQIHXTc9laHMO68uNnIm7eVja3b8BE="; + }; + + vendorHash = "sha256-9IhUGbcDeStFfQV+VEvPCwJUEvrsoiHdWxO0UHxQzqc="; + + makeFlags = [ + "PREFIX=\${out}" + ]; + + meta = with lib; { + description = "Utility to export messages, attachments and other data from Signal Desktop"; + license = licenses.isc; + platforms = platforms.all; + maintainers = with maintainers; [ fricklerhandwerk ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/stenc/default.nix b/nixpkgs/pkgs/tools/backup/stenc/default.nix new file mode 100644 index 000000000000..fb8d71c73119 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/stenc/default.nix @@ -0,0 +1,37 @@ +{ lib +, stdenv +, fetchFromGitHub +, gitUpdater +, autoreconfHook +}: + +stdenv.mkDerivation rec { + pname = "stenc"; + version = "1.1.1"; + + src = fetchFromGitHub { + owner = "scsitape"; + repo = "stenc"; + rev = version; + sha256 = "GcCRVkv+1mREq3MhMRn5fICthwI4WRQJSP6InuzxP1Q="; + }; + + postPatch = '' + # Fix gcc-13 build by pulling missing header. UPstream also fixed it + # in next major version, but there are many other patch dependencies. + # TODO: remove on next major version update + sed -e '1i #include <cstdint>' -i src/scsiencrypt.h + ''; + + nativeBuildInputs = [ autoreconfHook ]; + + passthru.updateScript = gitUpdater { }; + + meta = { + description = "SCSI Tape Encryption Manager"; + homepage = "https://github.com/scsitape/stenc"; + license = lib.licenses.gpl2; + maintainers = with lib.maintainers; [ woffs ]; + platforms = lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/store-backup/CVE-2020-7040.patch b/nixpkgs/pkgs/tools/backup/store-backup/CVE-2020-7040.patch new file mode 100644 index 000000000000..9b78f9bab95f --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/store-backup/CVE-2020-7040.patch @@ -0,0 +1,23 @@ +Index: storeBackup/lib/fileDir.pl +=================================================================== +--- storeBackup.orig/lib/fileDir.pl ++++ storeBackup/lib/fileDir.pl +@@ -21,7 +21,7 @@ + + + use Digest::MD5 qw(md5_hex); +-use Fcntl qw(O_RDWR O_CREAT); ++use Fcntl qw(O_RDWR O_CREAT O_WRONLY O_EXCL); + use Fcntl ':mode'; + use POSIX; + use Cwd 'abs_path'; +@@ -482,7 +482,7 @@ sub checkLockFile + '-str' => ["creating lock file <$lockFile>"]); + + &::checkDelSymLink($lockFile, $prLog, 0x01); +- open(FILE, '>', $lockFile) or ++ sysopen(FILE, $lockFile, O_WRONLY | O_CREAT | O_EXCL) or + $prLog->print('-kind' => 'E', + '-str' => ["cannot create lock file <$lockFile>"], + '-exit' => 1); + diff --git a/nixpkgs/pkgs/tools/backup/store-backup/default.nix b/nixpkgs/pkgs/tools/backup/store-backup/default.nix new file mode 100644 index 000000000000..506ea600cbcb --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/store-backup/default.nix @@ -0,0 +1,116 @@ +{lib, stdenv, which, coreutils, perl, fetchurl, makeWrapper, diffutils , writeScriptBin, bzip2}: + +# quick usage: +# storeBackup.pl --sourceDir /home/user --backupDir /tmp/my_backup_destination +# Its slow the first time because it compresses all files bigger than 1k (default setting) +# The backup tool is bookkeeping which files got compressed + +# btrfs warning: you may run out of hardlinks soon + +# known impurity: test cases seem to bu using /tmp/storeBackup.lock .. + +let dummyMount = writeScriptBin "mount" "#!${stdenv.shell}"; +in + +stdenv.mkDerivation rec { + + version = "3.5.2"; + + pname = "store-backup"; + + enableParallelBuilding = true; + + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ perl ]; + + src = fetchurl { + url = "https://download.savannah.gnu.org/releases/storebackup/storeBackup-${version}.tar.bz2"; + hash = "sha256-Ki1DT2zypFFiiMVd9Y8eSX7T+yr8moWMoALmAexjqWU="; + }; + + patches = [ + # https://www.openwall.com/lists/oss-security/2020/01/20/3 + ./CVE-2020-7040.patch + ]; + + installPhase = '' + mkdir -p $out/scripts + mv * $out + mv $out/_ATTENTION_ $out/doc + mv $out/{correct.sh,cron-storebackup} $out/scripts + + find $out -name "*.pl" | xargs sed -i \ + -e 's@/bin/pwd@${coreutils}/bin/pwd@' \ + -e 's@/bin/sync@${coreutils}/bin/sync@' \ + -e '1 s@/usr/bin/env perl@${perl.withPackages (p: [ p.DBFile ])}/bin/perl@' + + for p in $out/bin/* + do wrapProgram "$p" --prefix PATH ":" "${lib.makeBinPath [ which bzip2 ]}" + done + + patchShebangs $out + # do a dummy test ensuring this works + + PATH=$PATH:${dummyMount}/bin + + export USER=test + export HOME=$(mktemp -d) + { # simple sanity test, test backup/restore of simple store paths + + mkdir backup + + backupRestore(){ + source="$2" + echo ========= + echo RUNNING TEST "$1" source: "$source" + mkdir restored + + $out/bin/storeBackup.pl --sourceDir "$source" --backupDir backup + latestBackup=backup/default/$(ls -1 backup/default | sort | tail -n 1) + $out/bin/storeBackupRecover.pl -b "$latestBackup" -t restored -r / + ${diffutils}/bin/diff -r "$source" restored + + # storeBackupCheckSource should return 0 + $out/bin/storeBackupCheckSource.pl -s "$source" -b "$latestBackup" + # storeBackupCheckSource should return not 0 when using different source + ! $out/bin/storeBackupCheckSource.pl -s $TMP -b "$latestBackup" + + # storeBackupCheckBackup should return 0 + $out/bin/storeBackupCheckBackup.pl -c "$latestBackup" + + chmod -R +w restored + rm -fr restored + } + + testDir=$TMP/testDir + + mkdir $testDir + echo X > $testDir/X + ln -s ./X $testDir/Y + + backupRestore 'test 1: backup, restore' $testDir + + # test huge blocks, according to docs files bigger than 100MB get split + # into pieces + dd if=/dev/urandom bs=100M of=block-1 count=1 + dd if=/dev/urandom bs=100M of=block-2 count=1 + cat block-1 block-2 > $testDir/block + backupRestore 'test 1 with huge block' $testDir + + cat block-2 block-1 > $testDir/block + backupRestore 'test 1 with huge block reversed' $testDir + + backupRestore 'test 2: backup, restore' $out + backupRestore 'test 3: backup, restore' $out + backupRestore 'test 4: backup diffutils to same backup locations, restore' ${diffutils} + } + ''; + + meta = { + description = "A backup suite that stores files on other disks"; + homepage = "https://savannah.nongnu.org/projects/storebackup"; + license = lib.licenses.gpl3Plus; + maintainers = [lib.maintainers.marcweber]; + platforms = lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/tarsnap/default.nix b/nixpkgs/pkgs/tools/backup/tarsnap/default.nix new file mode 100644 index 000000000000..ad7fc761d843 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/tarsnap/default.nix @@ -0,0 +1,45 @@ +{ lib, stdenv, fetchurl, openssl, zlib, e2fsprogs, bzip2 }: + +let + zshCompletion = fetchurl { + url = "https://gist.githubusercontent.com/thoughtpolice/daa9431044883d3896f6/raw/282360677007db9739e5bf229873d3b231eb303a/tarsnap.zsh"; + sha256 = "0pawqwichzpz29rva7mh8lpx4zznnrh2rqyzzj6h7z98l0dxpair"; + }; +in +stdenv.mkDerivation rec { + pname = "tarsnap"; + version = "1.0.40"; + + src = fetchurl { + url = "https://www.tarsnap.com/download/tarsnap-autoconf-${version}.tgz"; + sha256 = "1mbzq81l4my5wdhyxyma04sblr43m8p7ryycbpi6n78w1hwfbjmw"; + }; + + preConfigure = '' + configureFlags="--with-bash-completion-dir=$out/share/bash-completion/completions" + ''; + + patchPhase = '' + substituteInPlace Makefile.in \ + --replace "command -p mv" "mv" + substituteInPlace configure \ + --replace "command -p getconf PATH" "echo $PATH" + ''; + + postInstall = '' + # Install some handy-dandy shell completions + install -m 444 -D ${zshCompletion} $out/share/zsh/site-functions/_tarsnap + ''; + + buildInputs = [ openssl zlib ] ++ lib.optional stdenv.isLinux e2fsprogs + ++ lib.optional stdenv.isDarwin bzip2; + + meta = { + description = "Online backups for the truly paranoid"; + homepage = "http://www.tarsnap.com/"; + license = lib.licenses.unfree; + platforms = lib.platforms.unix; + maintainers = with lib.maintainers; [ thoughtpolice roconnor ]; + mainProgram = "tarsnap"; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/tarsnapper/default.nix b/nixpkgs/pkgs/tools/backup/tarsnapper/default.nix new file mode 100644 index 000000000000..b4d731984f71 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/tarsnapper/default.nix @@ -0,0 +1,58 @@ +{ lib +, python3Packages +, fetchFromGitHub +, fetchpatch +, tarsnap +}: + +python3Packages.buildPythonApplication rec { + pname = "tarsnapper"; + version = "0.5"; + pyproject = true; + + src = fetchFromGitHub { + owner = "miracle2k"; + repo = pname; + rev = version; + hash = "sha256-5i9eum9hbh6VFhvEIDq5Uapy6JtIbf9jZHhRYZVoC1w="; + }; + + patches = [ + # Fix failing tests when default_deltas is None + (fetchpatch { + url = "https://github.com/miracle2k/tarsnapper/commit/2ee33ce748b9bb42d559cc2c0104115732cb4150.patch"; + hash = "sha256-fEXGhzlfB+J5lw1pcsC5Ne7I8UMnDzwyyCx/zm15+fU="; + }) + ]; + + nativeBuildInputs = with python3Packages; [ + pythonRelaxDepsHook + setuptools + ]; + + propagatedBuildInputs = with python3Packages; [ + pyyaml + python-dateutil + pexpect + ]; + + nativeCheckInputs = with python3Packages; [ + pytestCheckHook + nose + ]; + + # Remove standard module argparse from requirements + pythonRemoveDeps = [ "argparse" ]; + + makeWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath [ tarsnap ]}" ]; + + pythonImportsCheck = [ "tarsnapper" ]; + + meta = with lib; { + description = "Wrapper which expires backups using a gfs-scheme"; + homepage = "https://github.com/miracle2k/tarsnapper"; + license = licenses.bsd2; + maintainers = with maintainers; [ gmacon ]; + mainProgram = "tarsnapper"; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/tsm-client/default.nix b/nixpkgs/pkgs/tools/backup/tsm-client/default.nix new file mode 100644 index 000000000000..dedc7fdcd8e4 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/tsm-client/default.nix @@ -0,0 +1,208 @@ +{ lib +, callPackage +, nixosTests +, stdenv +, fetchurl +, autoPatchelfHook +, rpmextract +, libxcrypt-legacy +, zlib +, lvm2 # LVM image backup and restore functions (optional) +, acl # EXT2/EXT3/XFS ACL support (optional) +, gnugrep +, procps +, jdk8 # Java GUI (needed for `enableGui`) +, buildEnv +, makeWrapper +, enableGui ? false # enables Java GUI `dsmj` +# path to `dsm.sys` configuration files +, dsmSysCli ? "/etc/tsm-client/cli.dsm.sys" +, dsmSysApi ? "/etc/tsm-client/api.dsm.sys" +}: + + +# For an explanation of optional packages +# (features provided by them, version limits), see +# https://www.ibm.com/support/pages/node/660813#Version%208.1 + + +# IBM Tivoli Storage Manager Client uses a system-wide +# client system-options file `dsm.sys` and expects it +# to be located in a directory within the package. +# Note that the command line client and the API use +# different "dms.sys" files (located in different directories). +# Since these files contain settings to be altered by the +# admin user (e.g. TSM server name), we create symlinks +# in place of the files that the client attempts to open. +# Use the arguments `dsmSysCli` and `dsmSysApi` to +# provide the location of the configuration files for +# the command-line interface and the API, respectively. +# +# While the command-line interface contains wrappers +# that help the executables find the configuration file, +# packages that link against the API have to +# set the environment variable `DSMI_DIR` to +# point to this derivations `/dsmi_dir` directory symlink. +# Other environment variables might be necessary, +# depending on local configuration or usage; see: +# https://www.ibm.com/docs/en/storage-protect/8.1.21?topic=solaris-set-api-environment-variables + + +# The newest version of TSM client should be discoverable by +# going to the `downloadPage` (see `meta` below). +# Find the "Backup-archive client" table on that page. +# Look for "Download Documents" of the latest release. +# Follow the "Download Information" link. +# Look for the "Linux x86_64 ..." rows in the table at +# the bottom of the page and follow their "HTTPS" links (one +# link per row -- each link might point to the latest release). +# In the directory listings to show up, +# check the big `.tar` file. +# +# (as of 2023-07-01) + + +let + + meta = { + homepage = "https://www.ibm.com/products/storage-protect"; + downloadPage = "https://www.ibm.com/support/pages/ibm-storage-protect-downloads-latest-fix-packs-and-interim-fixes"; + platforms = [ "x86_64-linux" ]; + mainProgram = "dsmc"; + sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; + license = lib.licenses.unfree; + maintainers = [ lib.maintainers.yarny ]; + description = "IBM Storage Protect (Tivoli Storage Manager) CLI and API"; + longDescription = '' + IBM Storage Protect (Tivoli Storage Manager) provides + a single point of control for backup and recovery. + This package contains the client software, that is, + a command line client and linkable libraries. + + Note that the software requires a system-wide + client system-options file (commonly named "dsm.sys"). + This package allows to use separate files for + the command-line interface and for the linkable API. + The location of those files can + be provided as build parameters. + ''; + }; + + passthru.tests = { + test-cli = callPackage ./test-cli.nix {}; + test-gui = nixosTests.tsm-client-gui; + }; + + mkSrcUrl = version: + let + major = lib.versions.major version; + minor = lib.versions.minor version; + patch = lib.versions.patch version; + fixup = lib.lists.elemAt (lib.versions.splitVersion version) 3; + in + "https://public.dhe.ibm.com/storage/tivoli-storage-management/${if fixup=="0" then "maintenance" else "patches"}/client/v${major}r${minor}/Linux/LinuxX86/BA/v${major}${minor}${patch}/${version}-TIV-TSMBAC-LinuxX86.tar"; + + unwrapped = stdenv.mkDerivation rec { + name = "tsm-client-${version}-unwrapped"; + version = "8.1.21.0"; + src = fetchurl { + url = mkSrcUrl version; + hash = "sha512-iXkVYQsqbNhQJmrYl5a5433iSl6kg6YzlTlgCzpFGslMn+3ynSmYn8Rtxwitp931SwmV4a53tGctSuisz8pOCg=="; + }; + inherit meta passthru; + + nativeBuildInputs = [ + autoPatchelfHook + rpmextract + ]; + buildInputs = [ + libxcrypt-legacy + stdenv.cc.cc + zlib + ]; + runtimeDependencies = [ + (lib.attrsets.getLib lvm2) + ]; + sourceRoot = "."; + + postUnpack = '' + rpmextract TIVsm-API64.x86_64.rpm + rpmextract TIVsm-APIcit.x86_64.rpm + rpmextract TIVsm-BA.x86_64.rpm + rpmextract TIVsm-BAcit.x86_64.rpm + rpmextract TIVsm-BAhdw.x86_64.rpm + rpmextract TIVsm-JBB.x86_64.rpm + # use globbing so that version updates don't break the build: + rpmextract gskcrypt64-*.linux.x86_64.rpm + rpmextract gskssl64-*.linux.x86_64.rpm + ''; + + installPhase = '' + runHook preInstall + mkdir --parents $out + mv --target-directory=$out usr/* opt + runHook postInstall + ''; + + # fix relative symlinks after `/usr` was moved up one level, + # fix absolute symlinks pointing to `/opt` + preFixup = '' + for link in $out/lib{,64}/* $out/bin/* + do + target=$(readlink "$link") + if [ "$(cut -b -6 <<< "$target")" != "../../" ] + then + echo "cannot fix this symlink: $link -> $target" + exit 1 + fi + ln --symbolic --force --no-target-directory "$out/$(cut -b 7- <<< "$target")" "$link" + done + for link in $(find $out -type l -lname '/opt/*') + do + ln --symbolic --force --no-target-directory "$out$(readlink "$link")" "$link" + done + ''; + }; + + binPath = lib.makeBinPath ([ acl gnugrep procps ] + ++ lib.optional enableGui jdk8); + +in + +buildEnv { + name = "tsm-client-${unwrapped.version}"; + meta = meta // lib.attrsets.optionalAttrs enableGui { + mainProgram = "dsmj"; + }; + passthru = passthru // { inherit unwrapped; }; + paths = [ unwrapped ]; + nativeBuildInputs = [ makeWrapper ]; + pathsToLink = [ + "/" + "/bin" + "/opt/tivoli/tsm/client/ba/bin" + "/opt/tivoli/tsm/client/api/bin64" + ]; + # * Provide top-level symlinks `dsm_dir` and `dsmi_dir` + # to the so-called "installation directories" + # * Add symlinks to the "installation directories" + # that point to the `dsm.sys` configuration files + # * Drop the Java GUI executable unless `enableGui` is set + # * Create wrappers for the command-line interface to + # prepare `PATH` and `DSM_DIR` environment variables + postBuild = '' + ln --symbolic --no-target-directory opt/tivoli/tsm/client/ba/bin $out/dsm_dir + ln --symbolic --no-target-directory opt/tivoli/tsm/client/api/bin64 $out/dsmi_dir + ln --symbolic --no-target-directory "${dsmSysCli}" $out/dsm_dir/dsm.sys + ln --symbolic --no-target-directory "${dsmSysApi}" $out/dsmi_dir/dsm.sys + ${lib.optionalString (!enableGui) "rm $out/bin/dsmj"} + for bin in $out/bin/* + do + target=$(readlink "$bin") + rm "$bin" + makeWrapper "$target" "$bin" \ + --prefix PATH : "$out/dsm_dir:${binPath}" \ + --set DSM_DIR $out/dsm_dir + done + ''; +} diff --git a/nixpkgs/pkgs/tools/backup/tsm-client/test-cli.nix b/nixpkgs/pkgs/tools/backup/tsm-client/test-cli.nix new file mode 100644 index 000000000000..0858083c9f90 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/tsm-client/test-cli.nix @@ -0,0 +1,58 @@ +{ lib +, writeText +, runCommand +, tsm-client +}: + +# Let the client try to connect to a server. +# We can't simulate a server, so there's no more to test. + +let + + # 192.0.0.8 is a "dummy address" according to RFC 7600 + dsmSysCli = writeText "cli.dsm.sys" '' + defaultserver testserver + server testserver + commmethod v6tcpip + tcpserveraddress 192.0.0.8 + nodename ARBITRARYNODENAME + ''; + + tsm-client_ = tsm-client.override { inherit dsmSysCli; }; + + env.nativeBuildInputs = [ tsm-client_ ]; + + versionString = + let + inherit (tsm-client_.passthru.unwrapped) version; + major = lib.versions.major version; + minor = lib.versions.minor version; + patch = lib.versions.patch version; + fixup = lib.lists.elemAt (lib.versions.splitVersion version) 3; + in + "Client Version ${major}, Release ${minor}, Level ${patch}.${fixup}"; + +in + +runCommand "${tsm-client.name}-test-cli" env '' + set -o nounset + set -o pipefail + + export DSM_LOG=$(mktemp -d ./dsm_log.XXXXXXXXXXX) + + { dsmc -optfile=/dev/null || true; } | tee dsmc-stdout + + # does it report the correct version? + grep --fixed-strings '${versionString}' dsmc-stdout + + # does it use the provided dsm.sys config file? + # if it does, it states the node's name + grep ARBITRARYNODENAME dsmc-stdout + + # does it try (and fail) to connect to the server? + # if it does, it reports the "TCP/IP connection failure" error code + grep ANS1017E dsmc-stdout + grep ANS1017E $DSM_LOG/dsmerror.log + + touch $out +'' diff --git a/nixpkgs/pkgs/tools/backup/ugarit-manifest-maker/default.nix b/nixpkgs/pkgs/tools/backup/ugarit-manifest-maker/default.nix new file mode 100644 index 000000000000..8c37a7b72ac7 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/ugarit-manifest-maker/default.nix @@ -0,0 +1,31 @@ +{ pkgs, lib, eggDerivation, fetchegg }: +let + eggs = import ./eggs.nix { inherit eggDerivation fetchegg; }; +in with pkgs; eggDerivation rec { + pname = "ugarit-manifest-maker"; + version = "0.1"; + name = "${pname}-${version}"; + + src = fetchegg { + inherit version; + name = pname; + sha256 = "1jv8lhn4s5a3qphqd3zfwl1py0m5cmqj1h55ys0935m5f422547q"; + }; + + buildInputs = with eggs; [ + matchable + srfi-37 + fnmatch + miscmacros + ugarit + numbers + ]; + + meta = with lib; { + homepage = "https://www.kitten-technologies.co.uk/project/ugarit-manifest-maker/"; + description = "A tool for generating import manifests for Ugarit"; + license = licenses.bsd3; + maintainers = [ maintainers.ebzzry ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/ugarit-manifest-maker/eggs.nix b/nixpkgs/pkgs/tools/backup/ugarit-manifest-maker/eggs.nix new file mode 100644 index 000000000000..889d698188e2 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/ugarit-manifest-maker/eggs.nix @@ -0,0 +1,431 @@ +{ eggDerivation, fetchegg }: +rec { + blob-utils = eggDerivation { + name = "blob-utils-1.0.3"; + + src = fetchegg { + name = "blob-utils"; + version = "1.0.3"; + sha256 = "17vdn02fnxnjx5ixgqimln93lqvzyq4y9w02fw7xnbdcjzqm0xml"; + }; + + buildInputs = [ + setup-helper + string-utils + ]; + }; + + check-errors = eggDerivation { + name = "check-errors-1.13.0"; + + src = fetchegg { + name = "check-errors"; + version = "1.13.0"; + sha256 = "12a0sn82n98jybh72zb39fdddmr5k4785xglxb16750fhy8rmjwi"; + }; + + buildInputs = [ + setup-helper + ]; + }; + + crypto-tools = eggDerivation { + name = "crypto-tools-1.3"; + + src = fetchegg { + name = "crypto-tools"; + version = "1.3"; + sha256 = "0442wly63zis19vh8xc9nhxgp9sabaccxylpzmchd5f1d48iag65"; + }; + + buildInputs = [ + + ]; + }; + + fnmatch = eggDerivation { + name = "fnmatch-1.0.1"; + + src = fetchegg { + name = "fnmatch"; + version = "1.0.1"; + sha256 = "1m3jmyhkyqmjr7v628g6w5n3cqihcfnryrxn91k4597q7vjhikqr"; + }; + + buildInputs = [ + + ]; + }; + + foreigners = eggDerivation { + name = "foreigners-1.4.1"; + + src = fetchegg { + name = "foreigners"; + version = "1.4.1"; + sha256 = "07nvyadhkd52q0kkvch1a5d7ivpmrhmyg295s4mxb1nw4wz46gfz"; + }; + + buildInputs = [ + matchable + ]; + }; + + lookup-table = eggDerivation { + name = "lookup-table-1.13.5"; + + src = fetchegg { + name = "lookup-table"; + version = "1.13.5"; + sha256 = "1nzly6rhynawlvzlyilk8z8cxz57cf9n5iv20glkhh28pz2izmrb"; + }; + + buildInputs = [ + setup-helper + check-errors + miscmacros + record-variants + synch + ]; + }; + + lru-cache = eggDerivation { + name = "lru-cache-0.5.3"; + + src = fetchegg { + name = "lru-cache"; + version = "0.5.3"; + sha256 = "0z6g3106c4j21v968hfzy9nnbfq2d83y0nyd20aifpq4g55c0d40"; + }; + + buildInputs = [ + record-variants + ]; + }; + + matchable = eggDerivation { + name = "matchable-3.3"; + + src = fetchegg { + name = "matchable"; + version = "3.3"; + sha256 = "07y3lpzgm4djiwi9y2adc796f9kwkmdr28fkfkw65syahdax8990"; + }; + + buildInputs = [ + + ]; + }; + + message-digest = eggDerivation { + name = "message-digest-3.1.0"; + + src = fetchegg { + name = "message-digest"; + version = "3.1.0"; + sha256 = "1w6bax19dwgih78vcimiws0rja7qsd8hmbm6qqg2hf9cw3vab21s"; + }; + + buildInputs = [ + setup-helper + miscmacros + check-errors + variable-item + blob-utils + string-utils + ]; + }; + + miscmacros = eggDerivation { + name = "miscmacros-2.96"; + + src = fetchegg { + name = "miscmacros"; + version = "2.96"; + sha256 = "1ajdgjrni10i2hmhcp4rawnxajjxry3kmq1krdmah4sf0kjrgajc"; + }; + + buildInputs = [ + + ]; + }; + + numbers = eggDerivation { + name = "numbers-4.4"; + + src = fetchegg { + name = "numbers"; + version = "4.4"; + sha256 = "0bg5zs6jcr9arj4a7r2xqxf2n17bx93640jaivgchbdj1gixranm"; + }; + + buildInputs = [ + + ]; + }; + + parley = eggDerivation { + name = "parley-0.9.2"; + + src = fetchegg { + name = "parley"; + version = "0.9.2"; + sha256 = "1vsbx4dk1240gzq02slzmavd1jrq04qj7ssnvg15h8xh81xwhbbz"; + }; + + buildInputs = [ + stty + srfi-71 + miscmacros + ]; + }; + + pathname-expand = eggDerivation { + name = "pathname-expand-0.1"; + + src = fetchegg { + name = "pathname-expand"; + version = "0.1"; + sha256 = "14llya7l04z49xpi3iylk8aglrw968vy304ymavhhqlyzmzwkx3g"; + }; + + buildInputs = [ + + ]; + }; + + posix-extras = eggDerivation { + name = "posix-extras-0.1.6"; + + src = fetchegg { + name = "posix-extras"; + version = "0.1.6"; + sha256 = "0gnmhn2l0161ham7f8i0lx1ay94ap8l8l7ga4nw9qs86lk024abi"; + }; + + buildInputs = [ + + ]; + }; + + record-variants = eggDerivation { + name = "record-variants-0.5.1"; + + src = fetchegg { + name = "record-variants"; + version = "0.5.1"; + sha256 = "15wgysxkm8m4hx9nhhw9akchzipdnqc7yj3qd3zn0z7sxg4sld1h"; + }; + + buildInputs = [ + + ]; + }; + + regex = eggDerivation { + name = "regex-1.0"; + + src = fetchegg { + name = "regex"; + version = "1.0"; + sha256 = "1z9bh7xvab6h5cdlsz8jk02pv5py1i6ryqarbcs3wdgkkjgmmkif"; + }; + + buildInputs = [ + + ]; + }; + + setup-helper = eggDerivation { + name = "setup-helper-1.5.5"; + + src = fetchegg { + name = "setup-helper"; + version = "1.5.5"; + sha256 = "1lpplp8f2wyc486dd98gs4wl1kkhh1cs6vdqkxrdk7f92ikmwbx3"; + }; + + buildInputs = [ + + ]; + }; + + sql-de-lite = eggDerivation { + name = "sql-de-lite-0.6.6"; + + src = fetchegg { + name = "sql-de-lite"; + version = "0.6.6"; + sha256 = "1mh3hpsibq2gxcpjaycqa4ckznj268xpfzsa6pn0i6iac6my3qra"; + }; + + buildInputs = [ + lru-cache + foreigners + ]; + }; + + srfi-37 = eggDerivation { + name = "srfi-37-1.3.1"; + + src = fetchegg { + name = "srfi-37"; + version = "1.3.1"; + sha256 = "1a2zdkdzrv15fw9dfdy8067fsgh4kr8ppffm8mc3cmlczrrd58cb"; + }; + + buildInputs = [ + + ]; + }; + + srfi-71 = eggDerivation { + name = "srfi-71-1.1"; + + src = fetchegg { + name = "srfi-71"; + version = "1.1"; + sha256 = "01mlaxw2lfczykmx69xki2s0f4ywlg794rl4kz07plvzn0s3fbqq"; + }; + + buildInputs = [ + + ]; + }; + + ssql = eggDerivation { + name = "ssql-0.2.4"; + + src = fetchegg { + name = "ssql"; + version = "0.2.4"; + sha256 = "0qhnghhx1wrvav4s7l780mspwlh8s6kzq4bl0cslwp1km90fx9bk"; + }; + + buildInputs = [ + matchable + ]; + }; + + string-utils = eggDerivation { + name = "string-utils-1.2.4"; + + src = fetchegg { + name = "string-utils"; + version = "1.2.4"; + sha256 = "07alvghg0dahilrm4jg44bndl0x69sv1zbna9l20cbdvi35i0jp1"; + }; + + buildInputs = [ + setup-helper + miscmacros + lookup-table + check-errors + ]; + }; + + stty = eggDerivation { + name = "stty-0.2.6"; + + src = fetchegg { + name = "stty"; + version = "0.2.6"; + sha256 = "09jmjpdsd3yg6d0f0imcihmn49i28x09lgl60i2dllffs25k22s4"; + }; + + buildInputs = [ + setup-helper + foreigners + ]; + }; + + synch = eggDerivation { + name = "synch-2.1.2"; + + src = fetchegg { + name = "synch"; + version = "2.1.2"; + sha256 = "1m9mnbq0m5jsxmd1a3rqpwpxj0l1b7vn1fknvxycc047pmlcyl00"; + }; + + buildInputs = [ + setup-helper + check-errors + ]; + }; + + tiger-hash = eggDerivation { + name = "tiger-hash-3.1.0"; + + src = fetchegg { + name = "tiger-hash"; + version = "3.1.0"; + sha256 = "0j9dsbjp9cw0y4w4srg0qwgh53jw2v3mx4y4h040ds0fkxlzzknx"; + }; + + buildInputs = [ + message-digest + ]; + }; + + ugarit = eggDerivation { + name = "ugarit-2.0"; + + src = fetchegg { + name = "ugarit"; + version = "2.0"; + sha256 = "1l5zkr6b8l5dw9p5mimbva0ncqw1sbvp3d4cywm1hqx2m03a0f1n"; + }; + + buildInputs = [ + miscmacros + sql-de-lite + crypto-tools + srfi-37 + stty + matchable + regex + tiger-hash + message-digest + posix-extras + parley + ssql + pathname-expand + ]; + }; + + ugarit-manifest-maker = eggDerivation { + name = "ugarit-manifest-maker-0.1"; + + src = fetchegg { + name = "ugarit-manifest-maker"; + version = "0.1"; + sha256 = "1jv8lhn4s5a3qphqd3zfwl1py0m5cmqj1h55ys0935m5f422547q"; + }; + + buildInputs = [ + matchable + srfi-37 + fnmatch + miscmacros + ugarit + numbers + ]; + }; + + variable-item = eggDerivation { + name = "variable-item-1.3.1"; + + src = fetchegg { + name = "variable-item"; + version = "1.3.1"; + sha256 = "19b3mhb8kr892sz9yyzq79l0vv28dgilw9cf415kj6aq16yp4d5n"; + }; + + buildInputs = [ + setup-helper + check-errors + ]; + }; +} + diff --git a/nixpkgs/pkgs/tools/backup/ugarit/default.nix b/nixpkgs/pkgs/tools/backup/ugarit/default.nix new file mode 100644 index 000000000000..39c11cc0c91a --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/ugarit/default.nix @@ -0,0 +1,41 @@ +{ pkgs, lib, eggDerivation, fetchegg }: +let + eggs = import ./eggs.nix { inherit eggDerivation fetchegg; }; +in with pkgs; eggDerivation rec { + pname = "ugarit"; + version = "2.0"; + name = "${pname}-${version}"; + + src = fetchegg { + inherit version; + name = pname; + sha256 = "1l5zkr6b8l5dw9p5mimbva0ncqw1sbvp3d4cywm1hqx2m03a0f1n"; + }; + + buildInputs = with eggs; [ + aes + crypto-tools + matchable + message-digest + miscmacros + parley + pathname-expand + posix-extras + regex + sha2 + sql-de-lite + srfi-37 + ssql + stty + tiger-hash + z3 + ]; + + meta = with lib; { + homepage = "https://www.kitten-technologies.co.uk/project/ugarit/"; + description = "A backup/archival system based around content-addressible storage"; + license = licenses.bsd3; + maintainers = [ maintainers.ebzzry ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/ugarit/eggs.nix b/nixpkgs/pkgs/tools/backup/ugarit/eggs.nix new file mode 100644 index 000000000000..fe958cb55cc6 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/ugarit/eggs.nix @@ -0,0 +1,486 @@ +{ eggDerivation, fetchegg }: +rec { + aes = eggDerivation { + name = "aes-1.5"; + + src = fetchegg { + name = "aes"; + version = "1.5"; + sha256 = "0gjlvz5nk0fnaclljpyfk21rkf0nidjj6wcv3jbnpmfafgjny5fi"; + }; + + buildInputs = [ + + ]; + }; + + blob-utils = eggDerivation { + name = "blob-utils-1.0.3"; + + src = fetchegg { + name = "blob-utils"; + version = "1.0.3"; + sha256 = "17vdn02fnxnjx5ixgqimln93lqvzyq4y9w02fw7xnbdcjzqm0xml"; + }; + + buildInputs = [ + setup-helper + string-utils + ]; + }; + + check-errors = eggDerivation { + name = "check-errors-1.13.0"; + + src = fetchegg { + name = "check-errors"; + version = "1.13.0"; + sha256 = "12a0sn82n98jybh72zb39fdddmr5k4785xglxb16750fhy8rmjwi"; + }; + + buildInputs = [ + setup-helper + ]; + }; + + crypto-tools = eggDerivation { + name = "crypto-tools-1.3"; + + src = fetchegg { + name = "crypto-tools"; + version = "1.3"; + sha256 = "0442wly63zis19vh8xc9nhxgp9sabaccxylpzmchd5f1d48iag65"; + }; + + buildInputs = [ + + ]; + }; + + foreigners = eggDerivation { + name = "foreigners-1.4.1"; + + src = fetchegg { + name = "foreigners"; + version = "1.4.1"; + sha256 = "07nvyadhkd52q0kkvch1a5d7ivpmrhmyg295s4mxb1nw4wz46gfz"; + }; + + buildInputs = [ + matchable + ]; + }; + + lookup-table = eggDerivation { + name = "lookup-table-1.13.5"; + + src = fetchegg { + name = "lookup-table"; + version = "1.13.5"; + sha256 = "1nzly6rhynawlvzlyilk8z8cxz57cf9n5iv20glkhh28pz2izmrb"; + }; + + buildInputs = [ + setup-helper + check-errors + miscmacros + record-variants + synch + ]; + }; + + lru-cache = eggDerivation { + name = "lru-cache-0.5.3"; + + src = fetchegg { + name = "lru-cache"; + version = "0.5.3"; + sha256 = "0z6g3106c4j21v968hfzy9nnbfq2d83y0nyd20aifpq4g55c0d40"; + }; + + buildInputs = [ + record-variants + ]; + }; + + matchable = eggDerivation { + name = "matchable-3.3"; + + src = fetchegg { + name = "matchable"; + version = "3.3"; + sha256 = "07y3lpzgm4djiwi9y2adc796f9kwkmdr28fkfkw65syahdax8990"; + }; + + buildInputs = [ + + ]; + }; + + message-digest = eggDerivation { + name = "message-digest-3.1.0"; + + src = fetchegg { + name = "message-digest"; + version = "3.1.0"; + sha256 = "1w6bax19dwgih78vcimiws0rja7qsd8hmbm6qqg2hf9cw3vab21s"; + }; + + buildInputs = [ + setup-helper + miscmacros + check-errors + variable-item + blob-utils + string-utils + ]; + }; + + miscmacros = eggDerivation { + name = "miscmacros-2.96"; + + src = fetchegg { + name = "miscmacros"; + version = "2.96"; + sha256 = "1ajdgjrni10i2hmhcp4rawnxajjxry3kmq1krdmah4sf0kjrgajc"; + }; + + buildInputs = [ + + ]; + }; + + parley = eggDerivation { + name = "parley-0.9.2"; + + src = fetchegg { + name = "parley"; + version = "0.9.2"; + sha256 = "1vsbx4dk1240gzq02slzmavd1jrq04qj7ssnvg15h8xh81xwhbbz"; + }; + + buildInputs = [ + stty + srfi-71 + miscmacros + ]; + }; + + pathname-expand = eggDerivation { + name = "pathname-expand-0.1"; + + src = fetchegg { + name = "pathname-expand"; + version = "0.1"; + sha256 = "14llya7l04z49xpi3iylk8aglrw968vy304ymavhhqlyzmzwkx3g"; + }; + + buildInputs = [ + + ]; + }; + + posix-extras = eggDerivation { + name = "posix-extras-0.1.6"; + + src = fetchegg { + name = "posix-extras"; + version = "0.1.6"; + sha256 = "0gnmhn2l0161ham7f8i0lx1ay94ap8l8l7ga4nw9qs86lk024abi"; + }; + + buildInputs = [ + + ]; + }; + + record-variants = eggDerivation { + name = "record-variants-0.5.1"; + + src = fetchegg { + name = "record-variants"; + version = "0.5.1"; + sha256 = "15wgysxkm8m4hx9nhhw9akchzipdnqc7yj3qd3zn0z7sxg4sld1h"; + }; + + buildInputs = [ + + ]; + }; + + regex = eggDerivation { + name = "regex-1.0"; + + src = fetchegg { + name = "regex"; + version = "1.0"; + sha256 = "1z9bh7xvab6h5cdlsz8jk02pv5py1i6ryqarbcs3wdgkkjgmmkif"; + }; + + buildInputs = [ + + ]; + }; + + setup-helper = eggDerivation { + name = "setup-helper-1.5.5"; + + src = fetchegg { + name = "setup-helper"; + version = "1.5.5"; + sha256 = "1lpplp8f2wyc486dd98gs4wl1kkhh1cs6vdqkxrdk7f92ikmwbx3"; + }; + + buildInputs = [ + + ]; + }; + + sha2 = eggDerivation { + name = "sha2-3.1.0"; + + src = fetchegg { + name = "sha2"; + version = "3.1.0"; + sha256 = "01ch290f2kcv1yv8spjdaqwipl80vvgpqc4divsj3vxckvgkawq2"; + }; + + buildInputs = [ + message-digest + ]; + }; + + sql-de-lite = eggDerivation { + name = "sql-de-lite-0.6.6"; + + src = fetchegg { + name = "sql-de-lite"; + version = "0.6.6"; + sha256 = "1mh3hpsibq2gxcpjaycqa4ckznj268xpfzsa6pn0i6iac6my3qra"; + }; + + buildInputs = [ + lru-cache + foreigners + ]; + }; + + srfi-37 = eggDerivation { + name = "srfi-37-1.3.1"; + + src = fetchegg { + name = "srfi-37"; + version = "1.3.1"; + sha256 = "1a2zdkdzrv15fw9dfdy8067fsgh4kr8ppffm8mc3cmlczrrd58cb"; + }; + + buildInputs = [ + + ]; + }; + + srfi-71 = eggDerivation { + name = "srfi-71-1.1"; + + src = fetchegg { + name = "srfi-71"; + version = "1.1"; + sha256 = "01mlaxw2lfczykmx69xki2s0f4ywlg794rl4kz07plvzn0s3fbqq"; + }; + + buildInputs = [ + + ]; + }; + + ssql = eggDerivation { + name = "ssql-0.2.4"; + + src = fetchegg { + name = "ssql"; + version = "0.2.4"; + sha256 = "0qhnghhx1wrvav4s7l780mspwlh8s6kzq4bl0cslwp1km90fx9bk"; + }; + + buildInputs = [ + matchable + ]; + }; + + string-utils = eggDerivation { + name = "string-utils-1.2.4"; + + src = fetchegg { + name = "string-utils"; + version = "1.2.4"; + sha256 = "07alvghg0dahilrm4jg44bndl0x69sv1zbna9l20cbdvi35i0jp1"; + }; + + buildInputs = [ + setup-helper + miscmacros + lookup-table + check-errors + ]; + }; + + stty = eggDerivation { + name = "stty-0.2.6"; + + src = fetchegg { + name = "stty"; + version = "0.2.6"; + sha256 = "09jmjpdsd3yg6d0f0imcihmn49i28x09lgl60i2dllffs25k22s4"; + }; + + buildInputs = [ + setup-helper + foreigners + ]; + }; + + synch = eggDerivation { + name = "synch-2.1.2"; + + src = fetchegg { + name = "synch"; + version = "2.1.2"; + sha256 = "1m9mnbq0m5jsxmd1a3rqpwpxj0l1b7vn1fknvxycc047pmlcyl00"; + }; + + buildInputs = [ + setup-helper + check-errors + ]; + }; + + tiger-hash = eggDerivation { + name = "tiger-hash-3.1.0"; + + src = fetchegg { + name = "tiger-hash"; + version = "3.1.0"; + sha256 = "0j9dsbjp9cw0y4w4srg0qwgh53jw2v3mx4y4h040ds0fkxlzzknx"; + }; + + buildInputs = [ + message-digest + ]; + }; + + ugarit = eggDerivation { + name = "ugarit-2.0"; + + src = fetchegg { + name = "ugarit"; + version = "2.0"; + sha256 = "1l5zkr6b8l5dw9p5mimbva0ncqw1sbvp3d4cywm1hqx2m03a0f1n"; + }; + + buildInputs = [ + miscmacros + sql-de-lite + crypto-tools + srfi-37 + stty + matchable + regex + tiger-hash + message-digest + posix-extras + parley + ssql + pathname-expand + ]; + }; + + variable-item = eggDerivation { + name = "variable-item-1.3.1"; + + src = fetchegg { + name = "variable-item"; + version = "1.3.1"; + sha256 = "19b3mhb8kr892sz9yyzq79l0vv28dgilw9cf415kj6aq16yp4d5n"; + }; + + buildInputs = [ + setup-helper + check-errors + ]; + }; + + bind = eggDerivation { + name = "bind-1.5.2"; + + src = fetchegg { + name = "bind"; + version = "1.5.2"; + sha256 = "1x768k7dlfmkvgaf2idiaaqqgnqdnif5yb7ib6a6zndacbwz9jps"; + }; + + buildInputs = [ + silex + matchable + coops + regex + make + ]; + }; + + coops = eggDerivation { + name = "coops-1.93"; + + src = fetchegg { + name = "coops"; + version = "1.93"; + sha256 = "0mrkk7pmn9r691svzm4113mn0xsk36zi3f15m86n29a6c7897php"; + }; + + buildInputs = [ + matchable + record-variants + ]; + }; + + make = eggDerivation { + name = "make-1.8"; + + src = fetchegg { + name = "make"; + version = "1.8"; + sha256 = "1w6xsjyapi2x8dv21dpidkyw1kjfsbasddn554xx561pi3i0yv9h"; + }; + + buildInputs = [ + + ]; + }; + + silex = eggDerivation { + name = "silex-1.4"; + + src = fetchegg { + name = "silex"; + version = "1.4"; + sha256 = "17x7f07aa3qnay3bhjr7knjivhycs54j97jyv3gjs1h8qnp63g00"; + }; + + buildInputs = [ + + ]; + }; + + z3 = eggDerivation { + name = "z3-1.44"; + + src = fetchegg { + name = "z3"; + version = "1.44"; + sha256 = "16ayp4zkgm332q4bmjj22acqg197aqp6d8ifyyjj205iv6k0f3x4"; + }; + + buildInputs = [ + bind + ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/wal-e/default.nix b/nixpkgs/pkgs/tools/backup/wal-e/default.nix new file mode 100644 index 000000000000..544f61918de9 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/wal-e/default.nix @@ -0,0 +1,36 @@ +{ lib, fetchFromGitHub, python3Packages, lzop, postgresql, pv }: + +python3Packages.buildPythonApplication rec { + pname = "wal-e"; + version = "1.1.1"; + + namePrefix = ""; + + src = fetchFromGitHub { + owner = "wal-e"; + repo = "wal-e"; + rev = "v${version}"; + hash = "sha256-I6suHkAYzDtlNFNPH4SziY93Ryp+NTHkCBuojDvv+U4="; + }; + + # needs tox + doCheck = false; + + propagatedBuildInputs = (with python3Packages; [ + boto + gevent + google-cloud-storage + ]) ++ [ + postgresql + lzop + pv + ]; + + meta = { + description = "A Postgres WAL-shipping disaster recovery and replication toolkit"; + homepage = "https://github.com/wal-e/wal-e"; + maintainers = [ ]; + license = lib.licenses.bsd3; + platforms = lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/wal-g/default.nix b/nixpkgs/pkgs/tools/backup/wal-g/default.nix new file mode 100644 index 000000000000..6300dba6bff8 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/wal-g/default.nix @@ -0,0 +1,39 @@ +{ lib, buildGoModule, fetchFromGitHub, brotli, libsodium, installShellFiles }: + +buildGoModule rec { + pname = "wal-g"; + version = "2.0.1"; + + src = fetchFromGitHub { + owner = "wal-g"; + repo = "wal-g"; + rev = "v${version}"; + sha256 = "sha256-5mwA55aAHwEFabGZ6c3pi8NLcYofvoe4bb/cFj7NWok="; + }; + + vendorHash = "sha256-BbQuY6r30AkxlCZjY8JizaOrqEBdv7rIQet9KQwYB/g="; + + nativeBuildInputs = [ installShellFiles ]; + + buildInputs = [ brotli libsodium ]; + + subPackages = [ "main/pg" ]; + + tags = [ "brotli" "libsodium" ]; + + ldflags = [ "-s" "-w" "-X github.com/wal-g/wal-g/cmd/pg.WalgVersion=${version}" "-X github.com/wal-g/wal-g/cmd/pg.GitRevision=${src.rev}" ]; + + postInstall = '' + mv $out/bin/pg $out/bin/wal-g + installShellCompletion --cmd wal-g \ + --bash <($out/bin/wal-g completion bash) \ + --zsh <($out/bin/wal-g completion zsh) + ''; + + meta = with lib; { + homepage = "https://github.com/wal-g/wal-g"; + license = licenses.asl20; + description = "An archival restoration tool for PostgreSQL"; + maintainers = with maintainers; [ marsam ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/zbackup/default.nix b/nixpkgs/pkgs/tools/backup/zbackup/default.nix new file mode 100644 index 000000000000..021c85707a60 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/zbackup/default.nix @@ -0,0 +1,36 @@ +{ lib, stdenv, fetchFromGitHub +, cmake, protobufc +, libunwind, lzo, openssl, protobuf, zlib +}: + +stdenv.mkDerivation rec { + pname = "zbackup"; + version = "1.4.4"; + + src = fetchFromGitHub { + owner = "zbackup"; + repo = "zbackup"; + rev = version; + hash = "sha256-9Fk4EhEeQ2J4Kirc7oad4CzmW70Mmza6uozd87qfgZI="; + }; + + patches = [ + # compare with https://github.com/zbackup/zbackup/pull/158; + # but that doesn't apply cleanly to this version + ./protobuf-api-change.patch + ]; + + # zbackup uses dynamic exception specifications which are not + # allowed in C++17 + env.NIX_CFLAGS_COMPILE = toString [ "--std=c++14" ]; + + buildInputs = [ zlib openssl protobuf lzo libunwind ]; + nativeBuildInputs = [ cmake protobufc ]; + + meta = { + description = "A versatile deduplicating backup tool"; + homepage = "http://zbackup.org/"; + platforms = lib.platforms.linux; + license = lib.licenses.gpl2Plus; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/zbackup/protobuf-api-change.patch b/nixpkgs/pkgs/tools/backup/zbackup/protobuf-api-change.patch new file mode 100644 index 000000000000..d071709878be --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/zbackup/protobuf-api-change.patch @@ -0,0 +1,11 @@ +--- a/backup_restorer.cc ++++ b/backup_restorer.cc +@@ -48,7 +48,7 @@ + // TODO: this disables size checks for each separate message. Figure a better + // way to do this while keeping them enabled. It seems we need to create an + // instance of CodedInputStream for each message, but it might be expensive +- cis.SetTotalBytesLimit( backupData.size(), -1 ); ++ cis.SetTotalBytesLimit( backupData.size() ); + + // Used when emitting chunks + string chunk; diff --git a/nixpkgs/pkgs/tools/backup/zfs-autobackup/default.nix b/nixpkgs/pkgs/tools/backup/zfs-autobackup/default.nix new file mode 100644 index 000000000000..5999508fabf2 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/zfs-autobackup/default.nix @@ -0,0 +1,31 @@ +{ lib, python3Packages, fetchPypi }: + +python3Packages.buildPythonApplication rec { + pname = "zfs-autobackup"; + version = "3.2"; + + src = fetchPypi { + inherit version; + pname = "zfs_autobackup"; + sha256 = "sha256-rvtY7fsn2K2hueAsQkaPXcwxUAgE8j+GsQFF3eJKG2o="; + }; + + nativeBuildInputs = with python3Packages; [ pythonRelaxDepsHook ]; + + propagatedBuildInputs = with python3Packages; [ colorama ]; + + pythonRemoveDeps = [ "argparse" ]; + + # tests need zfs filesystem + doCheck = false; + + pythonImportsCheck = [ "zfs_autobackup" ]; + + meta = with lib; { + description = "ZFS backup, replicationand snapshot tool"; + homepage = "https://github.com/psy0rz/zfs_autobackup"; + changelog = "https://github.com/psy0rz/zfs_autobackup/releases/tag/v${version}"; + license = licenses.gpl3Only; + maintainers = with maintainers; [ ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/zfs-prune-snapshots/default.nix b/nixpkgs/pkgs/tools/backup/zfs-prune-snapshots/default.nix new file mode 100644 index 000000000000..2c9e4a2fdf8a --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/zfs-prune-snapshots/default.nix @@ -0,0 +1,30 @@ +{ lib, stdenv, fetchFromGitHub, go-md2man }: + +stdenv.mkDerivation rec { + version = "1.5.0"; + pname = "zfs-prune-snapshots"; + + src = fetchFromGitHub { + owner = "bahamas10"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-gCf/ZIeIh84WQNs5wZO1/l3zpnl2sNxsFO7cOa92JUM="; + }; + + nativeBuildInputs = [ go-md2man ]; + + makeTargets = [ "man" ]; + + installPhase = '' + install -m 755 -D zfs-prune-snapshots $out/bin/zfs-prune-snapshots + install -m 644 -D man/zfs-prune-snapshots.1 $out/share/man/man1/zfs-prune-snapshots.1 + ''; + + meta = with lib; { + description = "Remove snapshots from one or more zpools that match given criteria"; + homepage = "https://github.com/bahamas10/zfs-prune-snapshots"; + license = licenses.mit; + maintainers = [ maintainers.ymarkus ]; + platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/zfs-replicate/default.nix b/nixpkgs/pkgs/tools/backup/zfs-replicate/default.nix new file mode 100644 index 000000000000..df0ddfc7433b --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/zfs-replicate/default.nix @@ -0,0 +1,49 @@ +{ buildPythonApplication +, click +, fetchPypi +, hypothesis +, lib +, poetry-core +, pytest +, pytestCheckHook +, stringcase +}: + +buildPythonApplication rec { + pname = "zfs_replicate"; + version = "3.2.8"; + pyproject = true; + + src = fetchPypi { + inherit pname version; + hash = "sha256-q4m6/L7GZqCkvdKcWBGTfrbDC2UiFerluwNUOA+QCQU="; + }; + + postPatch = '' + sed -i pyproject.toml -e '/--cov[^"]*/d' + ''; + + nativeBuildInputs = [ + poetry-core + ]; + + nativeCheckInputs = [ + pytestCheckHook + hypothesis + pytest + ]; + + propagatedBuildInputs = [ + click + stringcase + ]; + + doCheck = true; + + meta = with lib; { + homepage = "https://github.com/alunduil/zfs-replicate"; + description = "ZFS Snapshot Replication"; + license = licenses.bsd2; + maintainers = with maintainers; [ alunduil ]; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/zfsbackup/default.nix b/nixpkgs/pkgs/tools/backup/zfsbackup/default.nix new file mode 100644 index 000000000000..d0f8972434a8 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/zfsbackup/default.nix @@ -0,0 +1,33 @@ +{ lib +, buildGoModule +, fetchFromGitHub +}: + +buildGoModule rec { + pname = "zfsbackup"; + version = "unstable-2022-09-23"; + rev = "a30f1a44bcae5f64cfb36a12926242a968a759c6"; + + src = fetchFromGitHub { + owner = "someone1"; + repo = "zfsbackup-go"; + inherit rev; + sha256 = "sha256-ZJ7gtT4AdMLEs2+hJa2Sia0hSoQd3CftdqRsH/oJxd8="; + }; + + vendorHash = "sha256-aYAficUFYYhZygfQZyczP49CeouAKKZJW8IFlkFh9lI="; + + ldflags = [ "-w" "-s" ]; + + # Tests require loading the zfs kernel module. + doCheck = false; + + meta = with lib; { + description = "Backup ZFS snapshots to cloud storage such as Google, Amazon, Azure, etc"; + homepage = "https://github.com/someone1/zfsbackup-go"; + license = licenses.mit; + maintainers = with maintainers; [ xfix ]; + platforms = platforms.linux; + mainProgram = "zfsbackup-go"; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/zfsnap/default.nix b/nixpkgs/pkgs/tools/backup/zfsnap/default.nix new file mode 100644 index 000000000000..36e369b4f30a --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/zfsnap/default.nix @@ -0,0 +1,42 @@ +{ lib, stdenv, fetchFromGitHub, coreutils, installShellFiles }: + +stdenv.mkDerivation rec { + version = "2.0.0-beta3"; + pname = "zfsnap"; + + src = fetchFromGitHub { + owner = "zfsnap"; + repo = "zfsnap"; + rev = "v${version}"; + sha256 = "0670a5sghvqx32c9gfsird15mg9nqcvwxsrfcjrwc0sj7br9bd2g"; + }; + + nativeBuildInputs = [ installShellFiles ]; + + postPatch = '' + # Use zfs binaries from PATH, because often the zfs package from nixpkgs is + # not the one that should be used + substituteInPlace share/zfsnap/core.sh \ + --replace "ZFS_CMD='/sbin/zfs'" "ZFS_CMD='zfs'" \ + --replace "ZPOOL_CMD='/sbin/zpool'" "ZPOOL_CMD='zpool'" + + substituteInPlace sbin/zfsnap.sh \ + --replace "/bin/ls" "${coreutils}/bin/ls" + ''; + + installPhase = '' + mkdir -p $out/bin + mv sbin/zfsnap.sh $out/bin/zfsnap + mv share $out + installManPage man/*/* + installShellCompletion completion/*.{bash,zsh} + ''; + + meta = with lib; { + description = "A portable, performant script to make rolling ZFS snapshots easy"; + homepage = "https://github.com/zfsnap/zfsnap"; + license = licenses.bsd3; + maintainers = with maintainers; [ woffs ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/znapzend/default.nix b/nixpkgs/pkgs/tools/backup/znapzend/default.nix new file mode 100644 index 000000000000..e4e7124477ae --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/znapzend/default.nix @@ -0,0 +1,68 @@ +{ lib, stdenv, fetchFromGitHub, fetchurl, perl, perlPackages, wget, autoconf, automake, autoreconfHook }: + +let + # when upgrade znapzend, check versions of Perl libs here: https://github.com/oetiker/znapzend/blob/master/cpanfile + # pinned versions are listed at https://github.com/oetiker/znapzend/blob/master/thirdparty/cpanfile-5.30.snapshot + Mojolicious' = perlPackages.buildPerlPackage rec { + pname = "Mojolicious"; + version = "8.73"; + src = fetchurl { + url = "mirror://cpan/authors/id/S/SR/SRI/${pname}-${version}.tar.gz"; + sha256 = "118y2264f89bbp5ly2dh36xjq25jk85s2ssxa3y4gsgsk6sjzzk1"; + }; + }; + MojoIOLoopForkCall' = perlPackages.buildPerlModule rec { + pname = "Mojo-IOLoop-ForkCall"; + version = "0.20"; + src = fetchurl { + url = "mirror://cpan/authors/id/J/JB/JBERGER/${pname}-${version}.tar.gz"; + sha256 = "19pih5x0ayxs2m8j29qwdpi6ky3w4ghv6vrmax3ix9r59hj6569b"; + }; + propagatedBuildInputs = [ perlPackages.IOPipely Mojolicious' ]; + }; + + perl' = perl.withPackages (p: + [ MojoIOLoopForkCall' + p.TAPParserSourceHandlerpgTAP + ]); + + version = "0.21.0"; + sha256 = "1lg46rf2ahlclan29zx8ag5k4fjp28sc9l02z76f0pvdlj4qnihl"; +in +stdenv.mkDerivation { + pname = "znapzend"; + inherit version; + + src = fetchFromGitHub { + owner = "oetiker"; + repo = "znapzend"; + rev = "v${version}"; + inherit sha256; + }; + + buildInputs = [ wget perl' ]; + + nativeBuildInputs = [ autoconf automake autoreconfHook ]; + + preConfigure = '' + sed -i 's/^SUBDIRS =.*$/SUBDIRS = lib/' Makefile.am + + grep -v thirdparty/Makefile configure.ac > configure.ac.tmp + mv configure.ac.tmp configure.ac + + autoconf + ''; + + preBuild = '' + aclocal + automake + ''; + + meta = with lib; { + description = "High performance open source ZFS backup with mbuffer and ssh support"; + homepage = "https://www.znapzend.org"; + license = licenses.gpl3; + maintainers = with maintainers; [ otwieracz ]; + platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/backup/zrepl/default.nix b/nixpkgs/pkgs/tools/backup/zrepl/default.nix new file mode 100644 index 000000000000..b0e0f75fe8c6 --- /dev/null +++ b/nixpkgs/pkgs/tools/backup/zrepl/default.nix @@ -0,0 +1,50 @@ +{ lib +, buildGoModule +, fetchFromGitHub +, makeWrapper +, nixosTests +, openssh +}: +buildGoModule rec { + pname = "zrepl"; + version = "0.6.1"; + + src = fetchFromGitHub { + owner = "zrepl"; + repo = "zrepl"; + rev = "v${version}"; + sha256 = "sha256-sFSWcJ0aBMay+ngUqnr0PKBMOfCcKHgBjff6KRpPZrg="; + }; + + vendorHash = "sha256-75fGejR7eiECsm1j3yIU1lAWaW9GrorrVnv8JEzkAtU="; + + subPackages = [ "." ]; + + nativeBuildInputs = [ + makeWrapper + ]; + + ldflags = [ "-s" "-w" "-X github.com/zrepl/zrepl/version.zreplVersion=${version}" ]; + + postInstall = '' + mkdir -p $out/lib/systemd/system + substitute dist/systemd/zrepl.service $out/lib/systemd/system/zrepl.service \ + --replace /usr/local/bin/zrepl $out/bin/zrepl + + wrapProgram $out/bin/zrepl \ + --prefix PATH : ${lib.makeBinPath [ openssh ]} + ''; + + passthru.tests = { + inherit (nixosTests) zrepl; + }; + + meta = with lib; { + homepage = "https://zrepl.github.io/"; + description = "A one-stop, integrated solution for ZFS replication"; + platforms = platforms.linux; + license = licenses.mit; + maintainers = with maintainers; [ cole-h danderson mdlayher ]; + mainProgram = "zrepl"; + }; +} |