add musicDirectory option to the mpd module

This commit is contained in:
jacekpoz 2024-04-27 22:55:26 +02:00
parent 3ee3fcd293
commit 862a33d976
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8
3 changed files with 32 additions and 3 deletions

20
hosts/chmura/acme.nix Normal file
View file

@ -0,0 +1,20 @@
_: {
users.users.caddy.extraGroups = [ "acme" ];
services.caddy = {
enable = true;
virtualHosts."acmechallenge.jacekpoz.pl" = {
serverAliases = [ "*.jacekpoz.pl" ];
extraConfig = ''
/.well-known/acme-challenge {
root * /var/lib/acme/.challenges
file_server
}
/ {
respond 301 https://$host$request_uri
}
'';
};
};
}

View file

@ -209,7 +209,10 @@
};
services = {
dunst.enable = true;
mpd.enable = true;
mpd = {
enable = true;
musicDirectory = "/run/media/data/Music";
};
greetd = {
enable = true;
greeter = "gtkgreet";

View file

@ -6,14 +6,20 @@
cfg = config.myOptions.services.mpd;
inherit (config.myOptions.other.system) username;
in {
options.myOptions.services.mpd.enable = mkEnableOption "mpd";
options.myOptions.services.mpd = {
enable = mkEnableOption "mpd";
musicDirectory = mkOption {
description = "music directory for mpd";
type = types.str;
};
};
config = mkIf cfg.enable {
home-manager.users.${username} = {
services = {
mpd = {
enable = true;
musicDirectory = "~/Music";
inherit (cfg) musicDirectory;
extraConfig = ''
audio_output {
type "pipewire"