1
0
Fork 0
mirror of https://git.oat.zone/dark-firepit/dotfiles synced 2024-04-27 23:35:05 +02:00
git.oat.zone--dark-firepit-.../modules/services/mpd.nix
System administrator ec00c09f2e Dotfiles
2022-01-11 17:44:40 +00:00

46 lines
772 B
Nix

{ config, lib, pkgs, options, ... }:
with lib;
let
audioSupport = config.modules.hardware.audio.enable;
cfg = config.modules.services.mpd;
in {
options.modules.services.mpd = {
enable = mkOption {
type = types.bool;
default = false;
};
musicDir = mkOption {
type = types.str;
default = "";
};
};
config = mkIf cfg.enable {
services.mpd = {
enable = true;
user = "aether";
};
home._.services.mpd = {
enable = true;
musicDirectory = builtins.trace cfg.musicDir cfg.musicDir;
extraConfig =
''
zeroconf_enabled "no"
restore_paused "yes"
replaygain "track"
''
+ (if audioSupport then
''
audio_output {
type "pipewire"
name "PipeWire Audio Server"
}
'' else "");
};
};
}