diff --git a/pkgs/tb-scripts/default.nix b/pkgs/tb-scripts/default.nix index 1d6240d..3bcb61c 100644 --- a/pkgs/tb-scripts/default.nix +++ b/pkgs/tb-scripts/default.nix @@ -12,23 +12,33 @@ pkgs.symlinkJoin { runtimeInputs = [ pkgs.jq ]; text = builtins.readFile ./jq_reformat.sh; }) + (pkgs.writers.writePython3Bin ",rename_lower" { libraries = [ ]; } (builtins.readFile ./rename_lower.py)) + (pkgs.writeShellApplication { name = ",zipdir"; runtimeInputs = [ pkgs.zip ]; text = builtins.readFile ./zipdir; }) + (pkgs.writeShellApplication { name = ",split-1G"; runtimeInputs = [ pkgs.coreutils ]; text = builtins.readFile ./split-1G; }) + (pkgs.writeShellApplication { name = ",pushover-send"; runtimeInputs = [ pkgs.curl ]; text = builtins.readFile ./pushover-send; }) + + (pkgs.writeShellApplication { + name = ",xz"; + runtimeInputs = [ pkgs.xz ]; + text = builtins.readFile ./xz; + }) ]; } diff --git a/pkgs/tb-scripts/xz b/pkgs/tb-scripts/xz new file mode 100755 index 0000000..c61c6af --- /dev/null +++ b/pkgs/tb-scripts/xz @@ -0,0 +1,13 @@ +#!/bin/sh -x + +PROCS=$(grep -c ^processor /proc/cpuinfo) + +if [ $# -eq 0 ]; then + (for f in *; do + echo "$f"; + done) | xargs -P"$PROCS" -d'\n' -n1 xz -9ve +else + (for f in "$@"; do + echo "$f"; + done) | xargs -P"$PROCS" -d'\n' -n1 xz -9ve +fi