From 162486191c1d6769f8d55298ac0ef10322c209e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Baylac=20Jacqu=C3=A9?= Date: Fri, 25 Aug 2023 23:08:17 +0200 Subject: [PATCH] Add Nix derivation --- README.md | 21 ++++----------------- default.nix | 11 +++++++++++ src/main.rs | 3 ++- 3 files changed, 17 insertions(+), 18 deletions(-) create mode 100644 default.nix diff --git a/README.md b/README.md index 2821c17..741a50e 100644 --- a/README.md +++ b/README.md @@ -22,23 +22,10 @@ This program is heavily inspired by Shotwell's backup feature. I actually used t ## Usage -Overall: +Send the files you want to backup via stdin, then point picobak to the directory where you archive your pictures: + +E.G: ```txt -Usage: pictures-backup [OPTIONS] - -Arguments: - Pictures library directory - Picture to backup - -Options: - -d, --dry-run Do not create any directory or copy any file. Only prints out the operations it would perform - -h, --help Print help - -V, --version Print version -``` - -For instance: - -```txt -ls dir-containing-pictures/* | picobak /my/pic-backup-root/ +ls /tmp/Sync2/* | picobak ~/nas/Photos-Video ``` diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..cecca46 --- /dev/null +++ b/default.nix @@ -0,0 +1,11 @@ +{ pkgs ? import {}, lib ? pkgs.lib }: + +pkgs.rustPlatform.buildRustPackage { + pname = "picobak"; + version = "0.1.0"; + src = lib.cleanSource ./.; + cargoHash = "sha256-gytrsYdL9WuxJDZBaK/w+1KLmAKKBD711efHTzQqs4o="; + meta = { + description = "Backup and organize your pictures library"; + }; +} diff --git a/src/main.rs b/src/main.rs index baff548..3c5eeff 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,7 +15,8 @@ use rayon::prelude::*; struct CliArgs { /// Pictures library directory backup_root: String, - /// Picture to backup + /// Picture to backup. Alternatively, you can send a list of + /// pictures to backup via stdin. file_path: Option, }