summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2019-12-19 07:16:05 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2019-12-19 07:16:05 +0100
commit793065d2a9e75c52c1dbd63f9cfa7bb97b31ab67 (patch)
treedde12c026da735106c66b7b7b98f31b99237d147
parent09bf279baf62e299c62884cfad8874a8c5929b0c (diff)
downloadnixos-793065d2a9e75c52c1dbd63f9cfa7bb97b31ab67.tar
nixos-793065d2a9e75c52c1dbd63f9cfa7bb97b31ab67.tar.gz
nixos-793065d2a9e75c52c1dbd63f9cfa7bb97b31ab67.tar.bz2
nixos-793065d2a9e75c52c1dbd63f9cfa7bb97b31ab67.tar.xz
nixos-793065d2a9e75c52c1dbd63f9cfa7bb97b31ab67.zip
have strm send to sif
-rw-r--r--odin/strm.nix2
-rw-r--r--odin/strm/cache_media2
-rw-r--r--odin/strm/download_youtube6
-rw-r--r--odin/strm/send_kitty2
-rw-r--r--odin/strm/send_media4
-rw-r--r--sif/hw.nix5
6 files changed, 14 insertions, 7 deletions
diff --git a/odin/strm.nix b/odin/strm.nix
index 487fd170..70034404 100644
--- a/odin/strm.nix
+++ b/odin/strm.nix
@@ -51,6 +51,8 @@ in stdenv.mkDerivation {
51 youtubedl = youtube-dl; 51 youtubedl = youtube-dl;
52 rollingdirectory = rolling-directory; 52 rollingdirectory = rolling-directory;
53 53
54 remoteNode = "sif";
55
54 buildPhase = '' 56 buildPhase = ''
55 substituteAllInPlace download_youtube 57 substituteAllInPlace download_youtube
56 substituteAllInPlace cleanup_youtube 58 substituteAllInPlace cleanup_youtube
diff --git a/odin/strm/cache_media b/odin/strm/cache_media
index c34e20fe..a6bd4732 100644
--- a/odin/strm/cache_media
+++ b/odin/strm/cache_media
@@ -42,5 +42,5 @@ while {
42done 42done
43 43
44if ${acted}; then 44if ${acted}; then
45 systemctl --no-block start uucico@hel.service 45 systemctl --no-block start uucico@@remoteNode@.service
46fi 46fi
diff --git a/odin/strm/download_youtube b/odin/strm/download_youtube
index f669fda4..f8c05fdf 100644
--- a/odin/strm/download_youtube
+++ b/odin/strm/download_youtube
@@ -348,10 +348,10 @@ printf ">>> %s <<<\n %s\n" "${msgId}" "${message}"
348 if [[ -n "$(notmuch search "tag:inbox AND $msgId")" ]]; then 348 if [[ -n "$(notmuch search "tag:inbox AND $msgId")" ]]; then
349 if [[ ${msgTags[(i)tv]} -le $#msgTags ]]; then 349 if [[ ${msgTags[(i)tv]} -le $#msgTags ]]; then
350 printf "%s\n%s\n" "Media available on odin" "${title}" \ 350 printf "%s\n%s\n" "Media available on odin" "${title}" \
351 | uux -r -p -n 'hel!notify-gkleen' -a download_youtube -u normal \ 351 | uux -r -p -n '@remoteNode@!notify-gkleen' -a download_youtube -u normal \
352 && print "Sent notification to hel via uucp" 352 && print "Sent notification to @remoteNode@ via uucp"
353 else 353 else
354 queue.hel -r "${filename}" && notmuch tag '-inbox' '-unread' -- $msgId 354 queue.@remoteNode@ -r "${filename}" && notmuch tag '-inbox' '-unread' -- $msgId
355 fi 355 fi
356 else 356 else
357 print "Message vanished from inbox" >&2 357 print "Message vanished from inbox" >&2
diff --git a/odin/strm/send_kitty b/odin/strm/send_kitty
index a1b7e836..ccebc361 100644
--- a/odin/strm/send_kitty
+++ b/odin/strm/send_kitty
@@ -42,5 +42,5 @@ tmpFile=$(mktemp --tmpdir=${concatDir} "${newfile:h}/.${newFile:t:r}.XXXXXX.mkv"
42ffmpeg -y -safe 0 -f concat -i =(awk $'{ print "file \'"$0"\'" }' ${fList}) -c:v libx264 -r 30 -crf 27 -preset veryfast -vf 'scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2' -metadata "description=$(xargs -a ${fList} -- basename -s ".mkv")" ${tmpFile} 42ffmpeg -y -safe 0 -f concat -i =(awk $'{ print "file \'"$0"\'" }' ${fList}) -c:v libx264 -r 30 -crf 27 -preset veryfast -vf 'scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2' -metadata "description=$(xargs -a ${fList} -- basename -s ".mkv")" ${tmpFile}
43chmod 440 ${tmpFile} 43chmod 440 ${tmpFile}
44mv -v ${tmpFile} ${newFile} 44mv -v ${tmpFile} ${newFile}
45queue.hel -p -r ${newFile} 45queue.@remoteNode@ -p -r ${newFile}
46ln -vfs $(realpath --relative-to=${lastFile:h} ${newFile}) ${lastFile} 46ln -vfs $(realpath --relative-to=${lastFile:h} ${newFile}) ${lastFile}
diff --git a/odin/strm/send_media b/odin/strm/send_media
index 4f3e576b..ecd6148f 100644
--- a/odin/strm/send_media
+++ b/odin/strm/send_media
@@ -73,9 +73,9 @@ while {
73 args=(-f $args) 73 args=(-f $args)
74 force=$(($force - 1)) 74 force=$(($force - 1))
75 fi 75 fi
76 queue.hel $args && notmuch tag -unread -inbox -- ${(q)id} 76 queue.@remoteNode@ $args && notmuch tag -unread -inbox -- ${(q)id}
77 ) 9<>"${message}" 77 ) 9<>"${message}"
78 done 78 done
79done 79done
80 80
81[[ -z "${checkedIds}" ]] && queue.hel 81[[ -z "${checkedIds}" ]] && queue.@remoteNode@
diff --git a/sif/hw.nix b/sif/hw.nix
index 17293c90..1a20bcf5 100644
--- a/sif/hw.nix
+++ b/sif/hw.nix
@@ -20,6 +20,11 @@
20 fsType = "btrfs"; 20 fsType = "btrfs";
21 }; 21 };
22 22
23 fileSystems."/var/media" =
24 { device = "/dev/disk/by-uuid/437eca70-d017-4d52-a1fa-2f4c7a87f096";
25 fsType = "btrfs";
26 };
27
23 swapDevices = 28 swapDevices =
24 [ { device = "/dev/disk/by-uuid/50f3f856-cc17-4614-846a-34a14d5006ec"; } 29 [ { device = "/dev/disk/by-uuid/50f3f856-cc17-4614-846a-34a14d5006ec"; }
25 ]; 30 ];