Add Nix derivation

This commit is contained in:
Félix Baylac Jacqué 2023-08-25 23:08:17 +02:00
parent ee9d8972e0
commit 162486191c
3 changed files with 17 additions and 18 deletions

View File

@ -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] <BACKUP_ROOT> <FILE_PATH>
Arguments:
<BACKUP_ROOT> Pictures library directory
<FILE_PATH> 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
```

11
default.nix Normal file
View File

@ -0,0 +1,11 @@
{ pkgs ? import <nixpkgs> {}, 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";
};
}

View File

@ -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<String>,
}