nixos/modules/media/mpd/default.nix

25 lines
508 B
Nix
Raw Normal View History

2023-07-05 18:17:24 +04:00
{ config, pkgs, lib, ...}:
2023-07-07 21:38:41 +04:00
with lib;
let cfg = config.modules.media.mpd;
in {
options.modules.media.mpd = {
enable = mkBoolOpt false;
2023-07-07 21:38:41 +04:00
};
config = mkIf cfg.enable {
2023-07-05 18:17:24 +04:00
services.mpd = {
enable = true;
# pipewire fix
user = "sako";
musicDirectory = "/home/sako/music";
2023-07-06 14:05:02 +04:00
extraConfig = builtins.readFile ../../../config/mpd/mpd.conf;
2023-07-05 18:20:36 +04:00
startWhenNeeded = true;
2023-07-05 18:17:24 +04:00
};
# systemd fix pipewire
systemd.services.mpd.environment = {
XDG_RUNTIME_DIR = "/run/user/1000";
};
2023-07-07 21:38:41 +04:00
};
2023-07-05 18:17:24 +04:00
}