Split into more modules

This commit is contained in:
Paul-Henri Froidmont 2023-03-23 19:01:42 +01:00
parent b6760195ce
commit 70f3e0a538
Signed by: phfroidmont
GPG key ID: BE948AFD7E7873BE
15 changed files with 219 additions and 124 deletions

34
modules/media/mpd.nix Normal file
View file

@ -0,0 +1,34 @@
{ config, lib, pkgs, ... }:
with lib;
with lib.my;
let cfg = config.modules.media.mpd;
in {
options.modules.media.mpd = { enable = mkBoolOpt false; };
config = mkIf cfg.enable {
home-manager.users.${config.user.name} = { config, ... }: {
services.mpd = {
enable = true;
network.listenAddress = "any";
musicDirectory = "${config.home.homeDirectory}/Nextcloud/Media/Music";
playlistDirectory = "${config.home.homeDirectory}/Nextcloud/Playlists";
extraConfig = ''
max_output_buffer_size "16384"
auto_update "yes"
audio_output {
type "pulse"
name "pulse audio"
device "pulse"
mixer_type "hardware"
}
audio_output {
type "fifo"
name "toggle_visualizer"
path "/tmp/mpd.fifo"
format "44100:16:2"
}
'';
};
};
};
}