8 cfg = config.services.ympd;
18 enable = lib.mkEnableOption "ympd, the MPD Web GUI";
20 webPort = lib.mkOption {
21 type = lib.types.either lib.types.str lib.types.port; # string for backwards compat
23 description = "The port where ympd's web interface will be available.";
24 example = "ssl://8080:/path/to/ssl-private-key.pem";
30 default = "localhost";
31 description = "The host where MPD is listening.";
35 type = lib.types.port;
36 default = config.services.mpd.network.port;
37 defaultText = lib.literalExpression "config.services.mpd.network.port";
38 description = "The port where MPD is listening.";
49 config = lib.mkIf cfg.enable {
51 systemd.services.ympd = {
52 description = "Standalone MPD Web GUI written in C";
54 wantedBy = [ "multi-user.target" ];
55 wants = [ "network-online.target" ];
56 after = [ "network-online.target" ];
60 ${pkgs.ympd}/bin/ympd \
61 --host ${cfg.mpd.host} \
62 --port ${toString cfg.mpd.port} \
63 --webport ${toString cfg.webPort}
67 NoNewPrivileges = true;
69 ProtectProc = "invisible";
70 ProtectSystem = "strict";
71 ProtectHome = "tmpfs";
74 PrivateDevices = true;
77 ProtectHostname = true;
79 ProtectKernelTunables = true;
80 ProtectKernelModules = true;
81 ProtectKernelLogs = true;
82 ProtectControlGroups = true;
84 RestrictAddressFamilies = [
88 RestrictRealtime = true;
89 RestrictSUIDSGID = true;