Compare commits

..

1 commit

Author SHA1 Message Date
24730484d5
feat: add beets 2024-12-18 12:14:00 +01:00
3 changed files with 38 additions and 51 deletions

View file

@ -1,34 +1,28 @@
{ pkgs, lib, ... }: { pkgs, lib, ... }:
let let
inherit (lib) concatStringsSep listToAttrs; inherit (lib) concatStringsSep attrNames;
plugins = [ plugins = {
"convert" convert.enable = true;
"chroma" chroma.enable = true;
"inline" inline.enable = true;
"fish" fish.enable = true;
"fetchart" fetchart.enable = true;
"lastgenre" lastgenre.enable = true;
"scrub" scrub.enable = true;
"duplicates" duplicates.enable = true;
"info" info.enable = true;
"missing" missing.enable = true;
"unimported" unimported.enable = true;
"badfiles" };
];
in in
{ {
config = { config = {
programs.beets = { programs.beets = {
package = pkgs.beets.override { package = pkgs.beets.override {
pluginOverrides = listToAttrs ( pluginOverrides = plugins;
map (name: {
value.enable = true;
inherit name;
}) plugins
);
}; };
settings = { settings = {
plugins = concatStringsSep " " plugins; plugins = concatStringsSep " " (attrNames plugins);
per_disc_numbering = "yes"; per_disc_numbering = "yes";
asciify_paths = true; asciify_paths = true;
convert = { convert = {
@ -42,7 +36,6 @@ in
maxwidth = 500; maxwidth = 500;
minwidth = 500; minwidth = 500;
enforce_ratio = true; enforce_ratio = true;
high_resolution = true;
}; };
duplicates = { duplicates = {
count = true; count = true;
@ -68,13 +61,12 @@ in
}; };
item_fields = { item_fields = {
disc_and_track = "u'%02i.%02i' % (disc, track) if disctotal > 1 else u'%02i' % (track)"; disc_and_track = "u'%02i.%02i' % (disc, track) if disctotal > 1 else u'%02i' % (track)";
primary_albumartist = # python primary_albumartist = ''
'' if albumartist.lower().strip().startswith(albumartists[0].lower().strip()):
if albumartist.lower().strip().startswith(albumartists[0].lower().strip()): return albumartists[0]
return albumartists[0] else:
else: return None
return None '';
'';
}; };
paths = { paths = {
default = "%ifdef{primary_albumartist, $primary_albumartist, $albumartist}/$album%aunique{}/$disc_and_track - $artist - $title"; default = "%ifdef{primary_albumartist, $primary_albumartist, $albumartist}/$album%aunique{}/$disc_and_track - $artist - $title";

View file

@ -9,27 +9,23 @@ in
clip = "wl-copy"; clip = "wl-copy";
}; };
functions = { functions = {
gitignore = # fish gitignore = "curl -sL https://www.gitignore.io/api/$argv";
"curl -sL https://www.gitignore.io/api/$argv"; mv-bad-creation-date = ''
mv-bad-creation-date = # fish ${getExe' pkgs.exiftool "exiftool"} -if 'not $CreateDate' -p '$FileName' "$PWD/$argv[1]" | xargs -I {} mv -i "$PWD/$argv[1]/{}" "$argv[2]"
'' '';
${getExe' pkgs.exiftool "exiftool"} -if 'not $CreateDate' -p '$FileName' "$PWD/$argv[1]" | xargs -I {} mv -i "$PWD/$argv[1]/{}" "$argv[2]" rename-images = ''
''; set -f input "$PWD/$argv[1]"
rename-images = # fish
''
set -f input "$PWD/$argv[1]"
if not test -d $input if not test -d $input
echo "input is not a directory" echo "input is not a directory"
else else
${getExe' pkgs.exiftool "exiftool"} -if '$CreateDate' -p '$FileName' "$input" | xargs -I {} jhead -n%Y-%m-%d-%H%M%S "$input/{}" ${getExe' pkgs.exiftool "exiftool"} -if '$CreateDate' -p '$FileName' "$input" | xargs -I {} jhead -n%Y-%m-%d-%H%M%S "$input/{}"
end end
''; '';
fish_prompt = builtins.readFile ./fish_prompt.fish; fish_prompt = builtins.readFile ./fish_prompt.fish;
revert = # fish revert = ''
'' env --chdir $HOME/.nixconf sudo nixos-rebuild switch --flake .#$(hostname) --rollback
env --chdir $HOME/.nixconf sudo nixos-rebuild switch --flake .#$(hostname) --rollback '';
'';
}; };
}; };
} }

View file

@ -6,8 +6,7 @@
base_domain = "ts"; base_domain = "ts";
nameservers.global = [ nameservers.global = [
#"100.64.0.4" "100.64.0.4"
"9.9.9.9"
]; ];
extra_records = extra_records =