From 43da9edb4598eef509c481ae0b305384418c45de Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Fri, 5 May 2023 19:41:58 -0700 Subject: 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. --- home/beets/default.nix | 67 -------------------------------------------------- 1 file changed, 67 deletions(-) delete mode 100644 home/beets/default.nix (limited to 'home/beets') diff --git a/home/beets/default.nix b/home/beets/default.nix deleted file mode 100644 index ab8cc43..0000000 --- a/home/beets/default.nix +++ /dev/null @@ -1,67 +0,0 @@ -{ config, lib, pkgs, ... }: -let - cfg = config.my.home.beets; - 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 -{ - options.my.home.beets = with lib; { - enable = mkEnableOption "beets configuration"; - musicDirectory = mkOption { - type = types.str; - example = "/home/fcuny/media/music"; - description = "path to the music directory"; - }; - }; - - config = lib.mkIf cfg.enable { - home.packages = with pkgs; [ bc-to-beet ]; - - 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"; - }; - }; - }; - }; -} -- cgit 1.4.1