nixfiles/hosts/tablet/profiles/mpd.nix

33 lines
790 B
Nix
Raw Normal View History

2022-11-10 11:25:33 +00:00
{ pkgs, tree, ... }: {
imports = with tree; [
./mpd-music-sync.nix
profiles.sound.pulseaudio.pulse-recv-native-localhost
];
environment.systemPackages = with pkgs; [ mpc_cli ];
systemd.tmpfiles.rules = [
"d /var/lib/mpd 0755 mpd mpd -"
"d /var/lib/mpd/data 0755 mpd mpd -"
"d /var/lib/mpd/playlists 0755 mpd mpd -"
];
services.mpd = {
enable = true;
dataDir = "/var/lib/mpd/data";
playlistDirectory = "/var/lib/mpd/playlists";
musicDirectory = "/music";
extraConfig = ''
host_permissions "127.0.0.1 read,add,control,admin"
audio_output {
type "pulse"
name "Pulseaudio"
server "127.0.0.1"
}
'';
};
systemd.services.mpd.serviceConfig.StateDirectory =
[ "/music" "/var/lib/mpd" ];
}