openvpn: calyx: fix after dependencies
[julm/julm-nix.git] / home-manager / profiles / bash.nix
index 17c9e1421c83265d7ce3d7b13a0fa861294eeaac..64c56e23f6f7a756d0c611e4388f4548a6bda3f2 100644 (file)
@@ -73,6 +73,13 @@ with lib;
       mkpass () {
         tr -d -C 'A-Za-z0-9' </dev/urandom | head -c 25 | xclip
       }
+      opusenc-voice () {
+        find "$@" -depth -type f -print0 | sort -n -z |
+        xargs -0 -P "$(lscpu --online -p | grep -v "#" | wc -l)" -I {} bash -c '
+            test -e "''${0%.*}".opus ||
+            nice -n 19 ffmpeg -y -i "$0" -map 0:a -b:a 32k -application voip "''${0%.*}".opus
+          ' {} \;
+      }
       smartctl-tbw () {
         device=''${1:-/dev/sda}
         sudo smartctl -A $device |