1
0
Fork 0
This commit is contained in:
Malte Brandy 2020-07-03 15:07:03 +02:00
parent 2b6b061953
commit 408e70fb81
No known key found for this signature in database
GPG key ID: 226A2D41EF5378C9
5 changed files with 53 additions and 42 deletions

View file

@ -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

View file

@ -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;
};
}

View 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";
};
};
}

View 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;
};
}

View file

@ -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";
};
};
}