home: added mpd service

This commit is contained in:
Aly Raffauf 2024-04-14 14:06:38 -04:00
parent ae5794f7a8
commit 16b6599c4d
2 changed files with 28 additions and 1 deletions

View file

@ -4,7 +4,7 @@
pkgs, pkgs,
... ...
}: { }: {
imports = [./syncthing ./easyeffects]; imports = [./syncthing ./easyeffects ./mpd];
userServices.syncthing.enable = lib.mkDefault true; userServices.syncthing.enable = lib.mkDefault true;
} }

View file

@ -0,0 +1,27 @@
{
pkgs,
lib,
config,
...
}: {
options = {
userServices.mpd.enable =
lib.mkEnableOption "MPD user service.";
userServices.mpd.musicDirectory = lib.mkOption {
description = "Name of music directory";
default = config.xdg.userDirs.music;
type = lib.types.str;
};
};
config = lib.mkIf config.userServices.mpd.enable {
services.mpd = {
enable = true;
musicDirectory = config.userServices.mpd.musicDirectory;
};
services.mpd-mpris = {
enable = true;
mpd.port = config.services.mpd.network.port;
};
};
}