Commit d2a7d406 authored by emilylange's avatar emilylange Committed by Valentin Gagarin
Browse files

nixos/sourcehut,sourcehut.*,nixosTests.sourcehut: drop

Sourcehut went a year with no update in nixpkgs, the packages did not
build for months, the module has issues at runtime, one of the
maintainers stopped using NixOS entirely and the other two don't respond
to issues.

Upstream has since also deprecated the Arch Linux and Debian
repositories to install Sourcehut. The only official way that remains is
Alpine Linux on x86_64-linux.
parent 629135df
Loading
Loading
Loading
Loading
+7 −12
Original line number Diff line number Diff line
@@ -1085,18 +1085,6 @@
  "module-services-taskserver-manual-ca-management": [
    "index.html#module-services-taskserver-manual-ca-management"
  ],
  "module-services-sourcehut": [
    "index.html#module-services-sourcehut"
  ],
  "module-services-sourcehut-basic-usage": [
    "index.html#module-services-sourcehut-basic-usage"
  ],
  "module-services-sourcehut-configuration": [
    "index.html#module-services-sourcehut-configuration"
  ],
  "module-services-sourcehut-httpd": [
    "index.html#module-services-sourcehut-httpd"
  ],
  "module-services-gitlab": [
    "index.html#module-services-gitlab"
  ],
@@ -2049,6 +2037,13 @@
  "sec-release-25.11-incompatibilities": [
    "release-notes.html#sec-release-25.11-incompatibilities"
  ],
  "sec-release-25.11-incompatibilities-sourcehut-removed": [
    "release-notes.html#sec-release-25.11-incompatibilities-sourcehut-removed",
    "index.html#module-services-sourcehut",
    "index.html#module-services-sourcehut-basic-usage",
    "index.html#module-services-sourcehut-configuration",
    "index.html#module-services-sourcehut-httpd"
  ],
  "sec-release-25.11-notable-changes": [
    "release-notes.html#sec-release-25.11-notable-changes"
  ],
+2 −0
Original line number Diff line number Diff line
@@ -62,6 +62,8 @@

- The Pocket ID module ([`services.pocket-id`][#opt-services.pocket-id.enable]) and package (`pocket-id`) has been updated to 1.0.0. Some environment variables have been changed or removed, see the [migration guide](https://pocket-id.org/docs/setup/migrate-to-v1/).

- []{#sec-release-25.11-incompatibilities-sourcehut-removed} The `services.sourcehut` module and corresponding `sourcehut` packages were removed due to being broken and unmaintained.

- The `yeahwm` package and `services.xserver.windowManager.yeahwm` module were removed due to the package being broken and unmaintained upstream.

- The `services.postgresql` module now sets up a systemd unit `postgresql.target`. Depending on `postgresql.target` guarantees that postgres is in read-write mode and initial/ensure scripts were executed. Depending on `postgresql.service` only guarantees a read-only connection.
+0 −1
Original line number Diff line number Diff line
@@ -915,7 +915,6 @@
  ./services/misc/sickbeard.nix
  ./services/misc/snapper.nix
  ./services/misc/soft-serve.nix
  ./services/misc/sourcehut
  ./services/misc/spice-autorandr.nix
  ./services/misc/spice-vdagentd.nix
  ./services/misc/spice-webdavd.nix
+3 −0
Original line number Diff line number Diff line
@@ -236,6 +236,9 @@ in
      the program being unmaintained. The options `programs.msmtp.*` can be
      used instead.
    '')
    (mkRemovedOptionModule [ "services" "sourcehut" ] ''
      The sourcehut packages and the corresponding module have been removed due to being broken and unmaintained.
    '')
    (mkRemovedOptionModule [ "services" "tvheadend" ]
      "The tvheadend package and the corresponding module have been removed as nobody was willing to maintain them and they were stuck on an unmaintained version that required FFmpeg 4; please see https://github.com/NixOS/nixpkgs/pull/332259 if you are interested in maintaining a newer version."
    )
+0 −93
Original line number Diff line number Diff line
# Sourcehut {#module-services-sourcehut}

[Sourcehut](https://sr.ht.com/) is an open-source,
self-hostable software development platform. The server setup can be automated using
[services.sourcehut](#opt-services.sourcehut.enable).

## Basic usage {#module-services-sourcehut-basic-usage}

Sourcehut is a Python and Go based set of applications.
This NixOS module also provides basic configuration integrating Sourcehut into locally running
`services.nginx`, `services.redis.servers.sourcehut`, `services.postfix`
and `services.postgresql` services.

A very basic configuration may look like this:
```nix
{ pkgs, ... }:
let
  fqdn =
    let
      join = hostName: domain: hostName + optionalString (domain != null) ".${domain}";
    in join config.networking.hostName config.networking.domain;
in {

  networking = {
    hostName = "srht";
    domain = "tld";
    firewall.allowedTCPPorts = [ 22 80 443 ];
  };

  services.sourcehut = {
    enable = true;
    git.enable = true;
    man.enable = true;
    meta.enable = true;
    nginx.enable = true;
    postfix.enable = true;
    postgresql.enable = true;
    redis.enable = true;
    settings = {
        "sr.ht" = {
          environment = "production";
          global-domain = fqdn;
          origin = "https://${fqdn}";
          # Produce keys with srht-keygen from sourcehut.coresrht.
          network-key = "/run/keys/path/to/network-key";
          service-key = "/run/keys/path/to/service-key";
        };
        webhooks.private-key= "/run/keys/path/to/webhook-key";
    };
  };

  security.acme.certs."${fqdn}".extraDomainNames = [
    "meta.${fqdn}"
    "man.${fqdn}"
    "git.${fqdn}"
  ];

  services.nginx = {
    enable = true;
    # only recommendedProxySettings are strictly required, but the rest make sense as well.
    recommendedTlsSettings = true;
    recommendedOptimisation = true;
    recommendedGzipSettings = true;
    recommendedProxySettings = true;

    # Settings to setup what certificates are used for which endpoint.
    virtualHosts = {
      "${fqdn}".enableACME = true;
      "meta.${fqdn}".useACMEHost = fqdn;
      "man.${fqdn}".useACMEHost = fqdn;
      "git.${fqdn}".useACMEHost = fqdn;
    };
  };
}
```

  The `hostName` option is used internally to configure the nginx
reverse-proxy. The `settings` attribute set is
used by the configuration generator and the result is placed in `/etc/sr.ht/config.ini`.

## Configuration {#module-services-sourcehut-configuration}

All configuration parameters are also stored in
`/etc/sr.ht/config.ini` which is generated by
the module and linked from the store to ensure that all values from `config.ini`
can be modified by the module.

## Using an alternative webserver as reverse-proxy (e.g. `httpd`) {#module-services-sourcehut-httpd}

By default, `nginx` is used as reverse-proxy for `sourcehut`.
However, it's possible to use e.g. `httpd` by explicitly disabling
`nginx` using [](#opt-services.nginx.enable) and fixing the
`settings`.
Loading