diff options
Diffstat (limited to '')
-rw-r--r-- | home/profiles/nas.nix | 58 | ||||
-rw-r--r-- | home/profiles/workstation.nix | 5 |
2 files changed, 48 insertions, 15 deletions
diff --git a/home/profiles/nas.nix b/home/profiles/nas.nix index c1e5ca9..d23f60b 100644 --- a/home/profiles/nas.nix +++ b/home/profiles/nas.nix @@ -4,15 +4,11 @@ let name = "bc-to-beet"; runtimeInputs = [ pkgs.beets ]; text = '' - ALBUM_PATH="$1" - ALBUM_NAME=$(basename "$ALBUM_PATH") - - mkdir -p ~/import - rm -rf ~/import/tmp-bc - unzip -d ~/import/tmp-bc ~/import/album.zip - beet import ~/import/tmp-bc - rm -rf ~/import/tmp-bc - rm -rf ~/import/album.zip + rm -rf ~/import/music/tmp-bc + unzip -d ~/import/music/tmp-bc ~/import/music/album.zip + beet import ~/import/music/tmp-bc + rm -rf ~/import/music/tmp-bc + rm -rf ~/import/music/album.zip ''; }; in @@ -26,15 +22,51 @@ in flac abcde (pkgs.writers.writeDashBin "rip-flac" '' - cd ~/import - ${pkgs.abcde}/bin/abcde -Vx -G -a "cddb,read,encode,tag,move,clean" -o flac + ${pkgs.abcde}/bin/abcde -c ~/.config/abcde/config '') ]; + # configuration file for abcde (see man 1 abcde) + xdg.configFile."abcde/config".source = pkgs.writeText "config" '' + ACTIONS=default,getalbumart + + ALBUMARTFILE="cover.jpg" + ALBUMARTTYPE="JPG" + + CDDBMETHOD=musicbrainz + + # cd ripping program + CDROMREADERSYNTAX=cdparanoia + CDPARANOIA=cdparanoia + CDPARANOIAOPTS="--never-skip=10" + + # move here + OUTPUTDIR="$HOME/import/music" + + # output type + FLACENCODERSYNTAX=flac + OUTPUTTYPE=flac + FLAC=flac + # --best is the same as -8 (highest compression) (also see -e) + FLACOPTS='--verify --best' + + EXTRAVERBOSE=2 + EJECTCD=y + MAXPROCS=4 + + post_encode () + { + # beets fixes some things (e.g. moving multi-disc albums together) and + # adds some extra info (e.g. genres with lastgenre) + echo "-------------- beets:" + beet import "$HOME/import/music" + } + ''; + programs.beets = { enable = true; settings = { - directory = cfg.musicDirectory; + directory = "/data/fast/music"; plugins = "fromfilename discogs duplicates fetchart embedart badfiles lastgenre scrub"; paths = { @@ -44,7 +76,7 @@ in "albumtype:soundtrack" = "Soundtracks/$album ($year)/$track $title"; }; import = { - copy = true; + copy = false; move = true; }; va_name = "Various Artists"; diff --git a/home/profiles/workstation.nix b/home/profiles/workstation.nix index e33db2d..74c927f 100644 --- a/home/profiles/workstation.nix +++ b/home/profiles/workstation.nix @@ -23,8 +23,9 @@ let NAS=$(tailscale status --json | jq -r '.Peer | map(select(.HostName == "tahoe"))[0].TailscaleIPs[0]') - scp "$ALBUM_PATH" "$NAS:~/import/album.zip" - ssh "$NAS" bc-to-beet ~/import/album.zip + ssh "$NAS" mkdir -p ~/import/music + scp "$ALBUM_PATH" "$NAS:~/import/music/album.zip" + ssh "$NAS" bc-to-beet ~/import/music/album.zip ''; }; in |