mirror of
https://github.com/Ahwxorg/nixos-config.git
synced 2025-12-04 15:00:13 +01:00
feat: adds basic mpd server
This commit is contained in:
parent
fc0dd5838e
commit
3504fb72f1
1 changed files with 22 additions and 0 deletions
22
modules/services/mpd.nix
Normal file
22
modules/services/mpd.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
{ username, config, ... }:
|
||||||
|
{
|
||||||
|
services.mpd = {
|
||||||
|
enable = true;
|
||||||
|
musicDirectory = "/dandelion/home/liv/music";
|
||||||
|
extraConfig = ''
|
||||||
|
audio_output {
|
||||||
|
type "pipewire"
|
||||||
|
name "pipewire"
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
user = "${username}"; # PipeWire requires this as it runs as the normal user and mpd normally runs as a system user.
|
||||||
|
|
||||||
|
# Optional:
|
||||||
|
# network.listenAddress = "any"; # if you want to allow non-localhost connections
|
||||||
|
network.startWhenNeeded = false; # systemd feature: only start MPD service upon connection to its socket
|
||||||
|
};
|
||||||
|
systemd.services.mpd.environment = {
|
||||||
|
# see: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/609
|
||||||
|
XDG_RUNTIME_DIR = "/run/user/${toString config.users.users.userRunningPipeWire.uid}"; # User-id must match above user. MPD will look inside this directory for the PipeWire socket.
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue