add media cp aliases to zsh

This commit is contained in:
Jonathan Dönszelmann 2024-11-15 22:19:26 +01:00
parent 720aaf0a93
commit 52b1728e2e
No known key found for this signature in database
3 changed files with 74 additions and 54 deletions

View file

@ -1,8 +1,22 @@
{ pkgs, ... }: {
{ pkgs, ... }:
{
calc = "${pkgs.python313}/bin/python -i ${
pkgs.writeText "init.py" ''
pkgs.writeText "init.py" ''
from math import *;
# import numpy as np
''
} ";
} ";
cp-media = name: media:
let
s = pkgs.writeScriptBin "cp-${name}" ''
echo "copying to library ${media}"
echo "calculating hash"
find "$1" - type f - print0 | sort - z | xargs - 0 sha1sum | awk '{
print $1}' | sha1sum | awk '{print $1}' > "$1.hash"
rsync -azP "$1" fili:/media/${media}
rsync -azP "$1.hash" fili:/media/${media}
'';
in
"${s}/bin/cp-${name}";
}