anchor.diff:          };
         })
         (lib.attrsets.setAttrByPath [ cfg.user "packages" ] [ cfg.package mastodonEnv ])
  +      (lib.mkIf cfg.configureNginx {${config.services.nginx.user}.extraGroups = [ cfg.user ];})
       ];
   
       users.groups.mastodon = lib.mkIf (cfg.group == "mastodon") { };
  
positive.code:         ++ (if cfg.automaticMigrations then [ "mastodon-init-db.service" ] else [ "mastodon-init-dirs.service" ]);
        description = "Mastodon web";
        wantedBy = [ "multi-user.target" ];
        environment = env // {
          PORT = toString(cfg.webPort);
        };
        serviceConfig = {
          ExecStart = "${cfg.package}/bin/puma -C config/puma.rb";
          Restart = "always";
  
negative.code:         };
  
          locations."@proxy" = {
            proxyPass = (if cfg.enableUnixSocket then "http://unix:/run/mastodon-web/web.socket" else "http://127.0.0.1:${toString(cfg.webPort)}");
            proxyWebsockets = true;
          };
  
          locations."/api/v1/streaming/" = {
            proxyPass = (if cfg.enableUnixSocket then "http://unix:/run/mastodon-streaming/streaming.socket" else "http://127.0.0.1:${toString(cfg.streamingPort)}/");
            proxyWebsockets = true;
          };
        };
  