1 { config, lib, pkgs, ... }:
6 cfg = config.services.ympd;
15 enable = mkEnableOption (lib.mdDoc "ympd, the MPD Web GUI");
18 type = types.either types.str types.port; # string for backwards compat
20 description = lib.mdDoc "The port where ympd's web interface will be available.";
21 example = "ssl://8080:/path/to/ssl-private-key.pem";
27 default = "localhost";
28 description = lib.mdDoc "The host where MPD is listening.";
33 default = config.services.mpd.network.port;
34 defaultText = literalExpression "config.services.mpd.network.port";
35 description = lib.mdDoc "The port where MPD is listening.";
47 config = mkIf cfg.enable {
49 systemd.services.ympd = {
50 description = "Standalone MPD Web GUI written in C";
51 wantedBy = [ "multi-user.target" ];
52 serviceConfig.ExecStart = "${pkgs.ympd}/bin/ympd --host ${cfg.mpd.host} --port ${toString cfg.mpd.port} --webport ${toString cfg.webPort} --user nobody";