From 7b53993ae2652d88cf933e3217328b2af34b76ef Mon Sep 17 00:00:00 2001 From: sstent Date: Thu, 2 Feb 2023 14:52:46 -0500 Subject: [PATCH] sync --- README.md | 6 + beets.nix | 154 +++++++++++++++++++++++++ beets_config_yaml => beets_config.yaml | 0 flake.nix | 4 +- home.nix | 6 +- 5 files changed, 167 insertions(+), 3 deletions(-) create mode 100644 beets.nix rename beets_config_yaml => beets_config.yaml (100%) diff --git a/README.md b/README.md index edd13a5..4b51263 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,12 @@ sh <(curl -L https://nixos.org/nix/install) --no-daemon . /home/sstent/.nix-profile/etc/profile.d/nix.sh ``` +## Enable flakes & nix-command +``` +mkdir -p ~/.config/nix/ +echo "experimental-features = nix-command flakes" > ~/.config/nix/nix.conf +``` + ## Setup channels and enable path ``` nix-channel --add https://github.com/rycee/home-manager/archive/master.tar.gz home-manager diff --git a/beets.nix b/beets.nix new file mode 100644 index 0000000..e787fcf --- /dev/null +++ b/beets.nix @@ -0,0 +1,154 @@ + +{ config, pkgs, lib, ... }: + +{ + programs.beets = { + enable = true; + settings = { + +{ + album_fields = { + artist_grouping = '' + albumartist_dev = ["devin townsend", "devin townsend project","punky brüster","strapping young lad"] + DevinFolder = "_Devin Townsend Projects" + if albumartist.lower() in albumartist_dev: + return DevinFolder + albumartist_les = ["primus", "les claypool","les claypool and the holy mackerel","les claypool’s duo de twang","oysterhead","colonel claypool’s bucket of bernie brains","the les claypool frog brigade","the claypool lennon delirium"] + LesFolder = "_Les Claypool Projects" + if albumartist.lower() in albumartist_les: + return LesFolder + ''; + atype = '' + atypes = ['EP', 'Single','Live'] + for atype in atypes: + if atype.lower() == albumtype.lower(): + return f' [{atype}]' + ''; + first_artist = "albumartist.split(', ',1)[0:1][0]"; + }; + albumtypes = { + bracket = "[]"; + ignore_va = "compilation"; + types = [ + { ep = "EP"; } + { single = "Single"; } + { soundtrack = "OST"; } + { live = "Live"; } + { compilation = "Anthology"; } + { remix = "Remix"; } + ]; + }; + aunique = { + bracket = "[]"; + disambiguators = "media"; + keys = "albumartist album"; + }; + copyartifacts = { extensions = ".cue .log .jpg .jpeg .png .txt"; }; + directory = "/mnt/q/CleanMusic/"; + embedart = { auto = true; }; + extrafiles = { + paths = { + artworkdir = "$albumpath/Artwork"; + "ext:cue" = "$albumpath/$disc_folder/Data/"; + "ext:jpg" = "$albumpath/$disc_folder/"; + "ext:log" = "$albumpath/$disc_folder/Data/"; + }; + patterns = { + all = "*.*"; + artworkdir = [ "[sS]cans/" "[aA]rtwork/" "[aA]rt/" "[cC]over/" ]; + }; + }; + fetchart = { + auto = true; + sources = "filesystem coverart itunes amazon albumart fanarttv"; + }; + import = { + autotag = true; + bell = false; + copy = true; + languages = "en"; + log = "~/beet/beet.log"; + move = false; + write = true; + }; + item_fields = { + isMultidisc = "1 if disctotal > 1 else 0"; + myBitDepth = "('' if bitdepth != 24 else '[24bit - '+ media + ']')"; + myDisc = "('' if disctotal <= 1 else str(disc) + ' - ')"; + mySongartist = + "artist + ' - ' if artist != albumartist and artist != '' else ''"; + }; + library = "~/musiclibrary.db"; + match = { + max_rec = { + album = "strong"; + album_id = "strong"; + albumdisambig = "strong"; + artist = "strong"; + catalognum = "strong"; + country = "strong"; + label = "strong"; + media = "strong"; + mediums = "strong"; + missing_tracks = "medium"; + source = "strong"; + track_artist = "strong"; + track_id = "strong"; + track_index = "strong"; + track_length = "strong"; + track_title = "strong"; + tracks = "strong"; + unmatched_tracks = "medium"; + year = "strong"; + }; + strong_rec_thresh = 5.0e-2; + }; + missing = { + format_album = "$albumartist: ($year) $album $albumtype $atype"; + format_item = "$albumartist - $album [$albumtype]$atype: $track/$tracktotal $title"; + }; + musicbrainz = { + pass = "7ANCLPczDNFn6Sf65vdZ"; + user = "shapechecker"; + }; + original_date = true; + paths = { + "albumtype:soundtrack" = "Soundtracks/$albumartist - $album%aunique{} ($year)/$myDisc$track - $artist - $title"; + comp = "Compilations/$albumartist/($year) $album%aunique{}/$myDisc$track - $artist - $title"; + default = "%if{$artist_grouping,$artist_grouping/}$first_artist/$year - $album $atype%aunique{media}[%upper{$format}${bitdepth}]%if{$media,[$media]}/%if{$isMultidisc,$disc - }$track - $mySongartist$title"; + }; + per_disc_numbering = true; + plugins = [ + "albumtypes" + "duplicates" + "fetchart" + "rewrite" + "missing" + "chroma" + "embedart" + "inline" + "discogs" + "mbcollection" + ]; + rewrite = { + "artist Björk & Tríó Guðmundar Ingólfssonar" = "Björk"; + "artist Brant Bjork and The Low Desert Punk Band" = "Brant Bjork"; + "artist King Gizzard & The Lizard Wizard with Mild High Club" = "King Gizzard & The Lizard Wizard"; + "artist Kyuss _ Queens of the Stone Age" = "Kyuss"; + "artist Professor Elemental & Tom Caruana" = "Professor Elemental"; + "artist Resin Dogs Feat Spikey Tee" = "Resin Dogs"; + "artist Sepultura _ Exodus" = "Sepultura"; + "artist The Knife in collaboration with Mount Sims and Planningtorock" = "The Knife"; + "artist Unida _ Dozer" = "Unida"; + }; +} + + + + }; + }; +} + + + + diff --git a/beets_config_yaml b/beets_config.yaml similarity index 100% rename from beets_config_yaml rename to beets_config.yaml diff --git a/flake.nix b/flake.nix index f4739a6..0a798b6 100644 --- a/flake.nix +++ b/flake.nix @@ -14,8 +14,10 @@ let system = "x86_64-linux"; pkgs = nixpkgs.legacyPackages.${system}; + formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt; + in { - homeConfigurations."sstent@StuPC" = home-manager.lib.homeManagerConfiguration { + homeConfigurations."sstent" = home-manager.lib.homeManagerConfiguration { inherit pkgs; # Specify your home configuration modules here, for example, diff --git a/home.nix b/home.nix index 53e65e7..b80abaf 100644 --- a/home.nix +++ b/home.nix @@ -45,7 +45,7 @@ services.keybase.enable = true; services.kbfs.enable = true; home.file.".mrconfig".source = ./mrconfig; -xdg.configFile."beets/config.yaml".source = ./beets_config_yaml; +# xdg.configFile."beets/config.yaml".source = ./beets_config.yaml; programs.bash = { enable = true; @@ -64,7 +64,6 @@ programs.bash = { }; - programs.git = { enable = true; userName = "sstent"; @@ -78,5 +77,8 @@ programs.bash = { }; }; +imports = [ + ./beets.nix +] }