diff --git a/homeManagerModules/userServices/default.nix b/homeManagerModules/userServices/default.nix index 157aeb20..628a77b5 100644 --- a/homeManagerModules/userServices/default.nix +++ b/homeManagerModules/userServices/default.nix @@ -4,7 +4,7 @@ pkgs, ... }: { - imports = [./syncthing ./easyeffects]; + imports = [./syncthing ./easyeffects ./mpd]; userServices.syncthing.enable = lib.mkDefault true; } diff --git a/homeManagerModules/userServices/mpd/default.nix b/homeManagerModules/userServices/mpd/default.nix new file mode 100644 index 00000000..e4602cd8 --- /dev/null +++ b/homeManagerModules/userServices/mpd/default.nix @@ -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; + }; + }; +}