Merge branch 'main' of git.sealight.xyz:aynish/helm
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
../profiles/wallabag
|
||||
../profiles/finance
|
||||
../profiles/sync/website
|
||||
../profiles/sync/music
|
||||
../profiles/grasp
|
||||
# ../profiles/archivebox
|
||||
# ../profiles/woodpecker-agent
|
||||
|
||||
@@ -23,12 +23,15 @@
|
||||
settings.PermitRootLogin = "no";
|
||||
};
|
||||
|
||||
hardware.keyboard.qmk.enable = true;
|
||||
services.udev.packages = with pkgs; [ via ];
|
||||
|
||||
# import profiling tools
|
||||
programs.systemtap.enable = true;
|
||||
|
||||
virtualisation.docker.enable = true;
|
||||
virtualisation.docker.storageDriver = "btrfs";
|
||||
environment.systemPackages = with pkgs; [ docker-compose ];
|
||||
environment.systemPackages = with pkgs; [ docker-compose via ];
|
||||
|
||||
# Speed up boot by removing dependency on network
|
||||
systemd = {
|
||||
@@ -69,7 +72,7 @@
|
||||
|
||||
# lazy enable of ports necessary for KDE connect which is installed via cli home profile (for some reason?)
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [ 22 4173 ]; # allow ssh
|
||||
allowedTCPPorts = [ 22 4173 3000 ]; # allow ssh and vibekanban
|
||||
allowedTCPPortRanges = [{
|
||||
from = 1714;
|
||||
to = 1764;
|
||||
|
||||
@@ -98,6 +98,7 @@ in {
|
||||
# tic-80
|
||||
ytfzf
|
||||
yt-dlp
|
||||
# autohide-tdrop
|
||||
];
|
||||
|
||||
xdg.portal = {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = [ pkgs.ffmpeg ];
|
||||
mossnet.gonic.enable = true;
|
||||
mossnet.gonic.settings = ''
|
||||
music-path /mnt/two/music/
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
# ardour
|
||||
# reaper
|
||||
# renoise
|
||||
bitwig-studio
|
||||
];
|
||||
|
||||
services.pulseaudio.enable = false;
|
||||
|
||||
@@ -5,16 +5,19 @@
|
||||
serviceConfig.Type = "oneshot";
|
||||
path = [
|
||||
pkgs.coreutils
|
||||
pkgs.openssh
|
||||
pkgs.gawk
|
||||
pkgs.rsync
|
||||
pkgs.beets
|
||||
];
|
||||
script = builtins.readFile ./get-music.sh;
|
||||
serviceConfig = {
|
||||
User = "anish";
|
||||
};
|
||||
};
|
||||
systemd.timers.get-music-timer = {
|
||||
systemd.timers.get-music-sync = {
|
||||
wantedBy = [ "timers.target" ];
|
||||
partOf = [ "get-music-sync.service" ];
|
||||
timerConfig.OnCalendar = [ "daily" ];
|
||||
timerConfig.OnCalendar = [ "hourly" ];
|
||||
};
|
||||
}
|
||||
|
||||
Regular → Executable
+58
-6
@@ -1,9 +1,61 @@
|
||||
#!/usr/bin/env bash
|
||||
rsync -r --ignore-existing --log-file=/data/incoming/download-log hypercube@talos.feralhosting.com:private/transmission/data/* /data/incoming
|
||||
|
||||
# you need to set defaults for beets
|
||||
# if already imported -> Skip
|
||||
# Auto accept changes
|
||||
# also install it lmao
|
||||
#beet import /data/incoming
|
||||
set -euo pipefail
|
||||
|
||||
REMOTE_HOST="aynish@talos.feralhosting.com"
|
||||
REMOTE_PATH="private/transmission/data/"
|
||||
LOCAL_PATH="/mnt/two/incoming"
|
||||
TRACKING_FILE="/mnt/two/incoming/.downloaded_albums"
|
||||
LOG_FILE="/mnt/two/incoming/download-log"
|
||||
|
||||
# Create tracking file if it doesn't exist
|
||||
touch "$TRACKING_FILE"
|
||||
|
||||
# Get list of albums on remote server
|
||||
echo "$(date): Checking for new albums on seedbox..." >>"$LOG_FILE"
|
||||
REMOTE_ALBUMS=$(rsync --dry-run --list-only "$REMOTE_HOST:$REMOTE_PATH" | grep '^d' | awk '{$1=$2=$3=$4=""; sub(/^ +/, ""); print}' | grep -v '^\.') || true
|
||||
|
||||
if [ -z "$REMOTE_ALBUMS" ]; then
|
||||
echo "$(date): No albums found on remote server" >>"$LOG_FILE"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Check each album against tracking file
|
||||
NEW_ALBUMS=""
|
||||
while IFS= read -r album; do
|
||||
if [ -n "$album" ] && ! grep -qF "$album" "$TRACKING_FILE"; then
|
||||
NEW_ALBUMS="$NEW_ALBUMS$album\n"
|
||||
echo "$(date): Found new album: $album" >>"$LOG_FILE"
|
||||
fi
|
||||
done <<<"$REMOTE_ALBUMS"
|
||||
|
||||
if [ -z "$NEW_ALBUMS" ]; then
|
||||
echo "$(date): No new albums to download" >>"$LOG_FILE"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Download new albums only
|
||||
echo "$(date): Starting download of new albums..." >>"$LOG_FILE"
|
||||
while IFS= read -r album; do
|
||||
if [ -n "$album" ]; then
|
||||
echo "$(date): Downloading $album" >>"$LOG_FILE"
|
||||
if rsync -r --log-file="$LOG_FILE" "$REMOTE_HOST:$REMOTE_PATH$album/" "$LOCAL_PATH/$album/"; then
|
||||
echo "$album" >>"$TRACKING_FILE"
|
||||
echo "$(date): Successfully downloaded $album" >>"$LOG_FILE"
|
||||
|
||||
# Import to beets
|
||||
echo "$(date): Importing $album to beets..." >>"$LOG_FILE"
|
||||
# Set umask to allow group read/write access
|
||||
umask 002
|
||||
if beet -p fetchart import -m -l /home/anish/music.log -q -g "$LOCAL_PATH/$album"; then
|
||||
echo "$(date): Successfully imported $album to beets" >>"$LOG_FILE"
|
||||
else
|
||||
echo "$(date): Failed to import $album to beets" >>"$LOG_FILE"
|
||||
fi
|
||||
else
|
||||
echo "$(date): Failed to download $album" >>"$LOG_FILE"
|
||||
fi
|
||||
fi
|
||||
done <<<"$(echo -e "$NEW_ALBUMS")"
|
||||
|
||||
echo "$(date): Music sync completed" >>"$LOG_FILE"
|
||||
|
||||
Reference in New Issue
Block a user