anchor.diff:          default = false;
           description = ''
             Whether to enable MPD, the music player daemon.
  +        '';
  +      };
  +
  +      startWhenNeeded = mkOption {
  +        type = types.bool;
  +        default = false;
  +        description = ''
  +          If set, <command>mpd</command> is socket-activated; that
  +          is, instead of having it permanently running as a daemon,
  +          systemd will start it on the first incoming connection.
           '';
         };
   
  
positive.code:         User = "${cfg.user}";
          PermissionsStartOnly = true;
          ExecStart = "${pkgs.mpd}/bin/mpd --no-daemon ${mpdConf}";
        };
      };
  
  
negative.code: 
    config = mkIf cfg.enable {
  
      systemd.sockets.mpd = mkIf cfg.startWhenNeeded {
        description = "Music Player Daemon Socket";
        wantedBy = [ "sockets.target" ];
        listenStreams = [
          "${optionalString (cfg.network.listenAddress != "any") "${cfg.network.listenAddress}:"}${toString cfg.network.port}"
        ];
        socketConfig = {
          Backlog = 5;
          KeepAlive = true;
          PassCredentials = true;
        };
      };
  
      systemd.services.mpd = {
        after = [ "network.target" "sound.target" ];
        description = "Music Player Daemon";
        wantedBy = optional (!cfg.startWhenNeeded) "multi-user.target";
  
        preStart = ''
          mkdir -p "${cfg.dataDir}" && chown -R ${cfg.user}:${cfg.group} "${cfg.dataDir}"
  