aboutsummaryrefslogtreecommitdiff
path: root/home/profiles/nas.nix
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2023-05-05 19:41:58 -0700
committerFranck Cuny <franck@fcuny.net>2023-05-05 19:41:58 -0700
commit43da9edb4598eef509c481ae0b305384418c45de (patch)
treea0ad614c90102757143e026e4fe1806431a3dbf4 /home/profiles/nas.nix
parentprofiles/default: users are immutable (diff)
downloadinfra-43da9edb4598eef509c481ae0b305384418c45de.tar.gz
home/profiles: move (almost) all modules to profiles
This is a major refactor, similar to what was done for the hosts, but in a single commit.
Diffstat (limited to 'home/profiles/nas.nix')
-rw-r--r--home/profiles/nas.nix67
1 files changed, 67 insertions, 0 deletions
diff --git a/home/profiles/nas.nix b/home/profiles/nas.nix
new file mode 100644
index 0000000..c1e5ca9
--- /dev/null
+++ b/home/profiles/nas.nix
@@ -0,0 +1,67 @@
+{ config, lib, pkgs, ... }:
+let
+ bc-to-beet = pkgs.writeShellApplication {
+ 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
+ '';
+ };
+in
+{
+ imports = [
+ ./ytdlp.nix
+ ];
+
+ home.packages = with pkgs; [
+ bc-to-beet
+ flac
+ abcde
+ (pkgs.writers.writeDashBin "rip-flac" ''
+ cd ~/import
+ ${pkgs.abcde}/bin/abcde -Vx -G -a "cddb,read,encode,tag,move,clean" -o flac
+ '')
+ ];
+
+ programs.beets = {
+ enable = true;
+ settings = {
+ directory = cfg.musicDirectory;
+ plugins =
+ "fromfilename discogs duplicates fetchart embedart badfiles lastgenre scrub";
+ paths = {
+ default = "$albumartist/$album%aunique{}/$track $title";
+ singleton = "Singles/$artist/$title";
+ comp = "Compilations/$album%aunique{}/$track - $title";
+ "albumtype:soundtrack" = "Soundtracks/$album ($year)/$track $title";
+ };
+ import = {
+ copy = true;
+ move = true;
+ };
+ va_name = "Various Artists";
+ embedart = { ifempty = true; };
+
+ lastgenre = {
+ auto = false;
+ canonical = true;
+ fallback = "unknown";
+ force = true;
+ prefer_specific = true;
+ };
+
+ fetchart = {
+ cautious = true;
+ sources = "filesystem coverart itunes amazon lastfm wikipedia";
+ };
+ };
+ };
+}