mpdstats
This commit is contained in:
parent
2b6b061953
commit
408e70fb81
|
@ -60,7 +60,8 @@ in {
|
|||
makeConfig "apollo" (imports ++ [
|
||||
./roles/zettelkasten.nix
|
||||
./battery.nix
|
||||
./mpd.nix
|
||||
./roles/mpd.nix
|
||||
./roles/beets.nix
|
||||
./mpclient.nix
|
||||
./on-my-machine.nix
|
||||
./desktop
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
{ pkgs, config, ... }:
|
||||
let musicDirectory = "${config.home.homeDirectory}/media/audio";
|
||||
in {
|
||||
home.file.".config/beets/config.yaml".text = builtins.toJSON {
|
||||
directory = musicDirectory;
|
||||
library = "~/.config/beets/musiclibrary.db";
|
||||
import = { move = true; };
|
||||
paths = {
|
||||
default = "$genre/%the{$albumartist}/$album%aunique{}/$track $title";
|
||||
singleton = "$genre/%the{$artist}/singles/$title";
|
||||
comp = "$genre/%the{$artist}/$album%aunique{}/$track $title";
|
||||
"genre:soundtrack" = "Soundtrack/$album%aunique{}/$track $title";
|
||||
"genre::classical" =
|
||||
"$genre/%the{$composer}/$album%aunique{}/$track $title";
|
||||
};
|
||||
plugins =
|
||||
"convert web mpdstats mpdupdate fromfilename the duplicates missing";
|
||||
convert = {
|
||||
auto = true;
|
||||
command =
|
||||
"${pkgs.ffmpeg}/bin/ffmpeg -i $source -y -vn -acodec libopus -ab 128k $dest";
|
||||
extension = "opus";
|
||||
never_convert_lossy_files = true;
|
||||
};
|
||||
};
|
||||
services = {
|
||||
mpd = {
|
||||
enable = true;
|
||||
inherit musicDirectory;
|
||||
extraConfig = ''
|
||||
audio_output {
|
||||
type "pulse"
|
||||
name "Pulseaudio"
|
||||
server "localhost"
|
||||
}
|
||||
'';
|
||||
};
|
||||
mpdris2.enable = true;
|
||||
};
|
||||
}
|
31
home-manager/roles/beets.nix
Normal file
31
home-manager/roles/beets.nix
Normal file
|
@ -0,0 +1,31 @@
|
|||
{ pkgs, config, ... }: {
|
||||
home.file.".config/beets/config.yaml".text = builtins.toJSON {
|
||||
directory = config.services.mpd.musicDirectory;
|
||||
import.move = true;
|
||||
paths = {
|
||||
default = "$genre/%the{$albumartist}/$album%aunique{}/$track. $title";
|
||||
singleton = "$genre/%the{$artist}/singles/$title";
|
||||
comp = "$genre/%the{$artist}/$album%aunique{}/$track. $title";
|
||||
"genre:soundtrack" = "Soundtrack/$album%aunique{}/$track. $title";
|
||||
"genre::classical" =
|
||||
"$genre/%the{$composer}/$album%aunique{}/$track. $title";
|
||||
};
|
||||
plugins =
|
||||
"convert web mpdstats mpdupdate fromfilename the duplicates missing";
|
||||
convert = {
|
||||
auto = true;
|
||||
command =
|
||||
"${pkgs.ffmpeg}/bin/ffmpeg -i $source -y -vn -acodec libopus -ab 128k $dest";
|
||||
extension = "opus";
|
||||
never_convert_lossy_files = true;
|
||||
};
|
||||
};
|
||||
systemd.user.services.beets-mpdstats = {
|
||||
Unit.Description = "beets.io mpdstats recorder";
|
||||
Install.WantedBy = [ "default.target" ];
|
||||
Service = {
|
||||
ExecStart = "${pkgs.beets}/bin/beet mpdstats";
|
||||
Restart = "always";
|
||||
};
|
||||
};
|
||||
}
|
16
home-manager/roles/mpd.nix
Normal file
16
home-manager/roles/mpd.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ pkgs, config, ... }: {
|
||||
services = {
|
||||
mpd = {
|
||||
enable = true;
|
||||
musicDirectory = "${config.home.homeDirectory}/media/audio";
|
||||
extraConfig = ''
|
||||
audio_output {
|
||||
type "pulse"
|
||||
name "Pulseaudio"
|
||||
server "localhost"
|
||||
}
|
||||
'';
|
||||
};
|
||||
mpdris2.enable = true;
|
||||
};
|
||||
}
|
|
@ -6,6 +6,9 @@ in {
|
|||
systemd.user.services.neuron = {
|
||||
Unit.Description = "Neuron zettelkasten service";
|
||||
Install.WantedBy = [ "graphical-session.target" ];
|
||||
Service.ExecStart = cmd;
|
||||
Service = {
|
||||
ExecStart = cmd;
|
||||
Restart = "always";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue