nixfiles/hosts/lappy/profiles/mpd.nix

30 lines
739 B
Nix
Raw Normal View History

2022-01-23 11:48:43 +00:00
{ pkgs, tree, ... }: {
2022-01-26 23:05:24 +00:00
imports = [ ./mpd-music-sync.nix ];
2022-01-23 11:48:43 +00:00
2022-01-26 23:05:24 +00:00
environment.systemPackages = with pkgs; [ mpc_cli mpv roc-toolkit-patched ];
2022-01-23 11:48:43 +00:00
2022-01-25 13:01:22 +00:00
systemd.tmpfiles.rules = [
2022-01-23 11:48:43 +00:00
"d /var/lib/mpd 0755 mpd mpd -"
"d /var/lib/mpd/data 0755 mpd mpd -"
2022-01-25 13:01:22 +00:00
"d /var/lib/mpd/playlists 0755 mpd mpd -"
];
2022-01-23 11:48:43 +00:00
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"
}
'';
};
2022-01-25 13:01:22 +00:00
systemd.services.mpd.serviceConfig.StateDirectory =
[ "/music" "/var/lib/mpd" ];
2022-01-23 11:48:43 +00:00
}