mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-02 21:10:08 +00:00
go-neb: drop
Upstream discontinued it: https://github.com/matrix-org/go-neb
This commit is contained in:
@@ -1,88 +1,10 @@
|
||||
{ lib, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.services.go-neb;
|
||||
|
||||
settingsFormat = pkgs.formats.yaml { };
|
||||
configFile = settingsFormat.generate "config.yaml" cfg.config;
|
||||
in
|
||||
{
|
||||
options.services.go-neb = {
|
||||
enable = lib.mkEnableOption "an extensible matrix bot written in Go";
|
||||
|
||||
bindAddress = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Port (and optionally address) to listen on.";
|
||||
default = ":4050";
|
||||
};
|
||||
|
||||
secretFile = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.path;
|
||||
default = null;
|
||||
example = "/run/keys/go-neb.env";
|
||||
description = ''
|
||||
Environment variables from this file will be interpolated into the
|
||||
final config file using envsubst with this syntax: `$ENVIRONMENT`
|
||||
or `''${VARIABLE}`.
|
||||
The file should contain lines formatted as `SECRET_VAR=SECRET_VALUE`.
|
||||
This is useful to avoid putting secrets into the nix store.
|
||||
'';
|
||||
};
|
||||
|
||||
baseUrl = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Public-facing endpoint that can receive webhooks.";
|
||||
};
|
||||
|
||||
config = lib.mkOption {
|
||||
inherit (settingsFormat) type;
|
||||
description = ''
|
||||
Your {file}`config.yaml` as a Nix attribute set.
|
||||
See [config.sample.yaml](https://github.com/matrix-org/go-neb/blob/master/config.sample.yaml)
|
||||
for possible options.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
systemd.services.go-neb =
|
||||
let
|
||||
finalConfigFile = if cfg.secretFile == null then configFile else "/var/run/go-neb/config.yaml";
|
||||
in
|
||||
{
|
||||
description = "Extensible matrix bot written in Go";
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
environment = {
|
||||
BASE_URL = cfg.baseUrl;
|
||||
BIND_ADDRESS = cfg.bindAddress;
|
||||
CONFIG_FILE = finalConfigFile;
|
||||
};
|
||||
|
||||
serviceConfig = {
|
||||
ExecStartPre = lib.optional (cfg.secretFile != null) (
|
||||
"+"
|
||||
+ pkgs.writeShellScript "pre-start" ''
|
||||
umask 077
|
||||
export $(xargs < ${cfg.secretFile})
|
||||
${pkgs.envsubst}/bin/envsubst -i "${configFile}" > ${finalConfigFile}
|
||||
chown go-neb ${finalConfigFile}
|
||||
''
|
||||
);
|
||||
RuntimeDirectory = "go-neb";
|
||||
ExecStart = "${pkgs.go-neb}/bin/go-neb";
|
||||
User = "go-neb";
|
||||
DynamicUser = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
meta.maintainers = with lib.maintainers; [
|
||||
hexa
|
||||
maralorn
|
||||
imports = [
|
||||
(lib.mkRemovedOptionModule [ "services" "go-neb" ] ''
|
||||
The Go-NEB project was discontinued by Matrix.org and archived in June
|
||||
2023. Use matrix-hookshot or another maintained Matrix bot instead.
|
||||
'')
|
||||
];
|
||||
}
|
||||
|
||||
@@ -720,7 +720,6 @@ in
|
||||
go-camo = runTest ./go-camo.nix;
|
||||
go-csp-collector = runTest ./go-csp-collector.nix;
|
||||
go-httpbin = runTest ./go-httpbin.nix;
|
||||
go-neb = runTest ./go-neb.nix;
|
||||
goatcounter = runTest ./goatcounter.nix;
|
||||
gobgpd = runTest ./gobgpd.nix;
|
||||
gocd-agent = runTest ./gocd-agent.nix;
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
name = "go-neb";
|
||||
meta = with pkgs.lib.maintainers; {
|
||||
maintainers = [
|
||||
hexa
|
||||
maralorn
|
||||
];
|
||||
};
|
||||
|
||||
nodes = {
|
||||
server = {
|
||||
services.go-neb = {
|
||||
enable = true;
|
||||
baseUrl = "http://localhost";
|
||||
secretFile = pkgs.writeText "secrets" "ACCESS_TOKEN=changeme";
|
||||
config = {
|
||||
clients = [
|
||||
{
|
||||
UserId = "@test:localhost";
|
||||
AccessToken = "$ACCESS_TOKEN";
|
||||
HomeServerUrl = "http://localhost";
|
||||
Sync = false;
|
||||
AutoJoinRooms = false;
|
||||
DisplayName = "neverbeseen";
|
||||
}
|
||||
];
|
||||
services = [
|
||||
{
|
||||
ID = "wikipedia_service";
|
||||
Type = "wikipedia";
|
||||
UserID = "@test:localhost";
|
||||
Config = { };
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
start_all()
|
||||
server.wait_for_unit("go-neb.service")
|
||||
server.wait_until_succeeds("curl -fL http://localhost:4050/services/hooks/d2lraXBlZGlhX3NlcnZpY2U")
|
||||
server.succeed(
|
||||
"journalctl -eu go-neb -o cat | grep -q service_id=wikipedia_service",
|
||||
"grep -q changeme /var/run/go-neb/config.yaml",
|
||||
)
|
||||
'';
|
||||
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
buildGoModule,
|
||||
fetchFromGitHub,
|
||||
nixosTests,
|
||||
olm,
|
||||
}:
|
||||
|
||||
buildGoModule {
|
||||
pname = "go-neb";
|
||||
version = "unstable-2021-07-21";
|
||||
src = fetchFromGitHub {
|
||||
owner = "matrix-org";
|
||||
repo = "go-neb";
|
||||
rev = "8916c80f8ce1732f64b50f9251242ca189082e76";
|
||||
sha256 = "sha256-kuH4vbvS4G1bczxUdY4bd4oL4pIZzuueUxdEp4xuzJM=";
|
||||
};
|
||||
|
||||
subPackages = [ "." ];
|
||||
|
||||
buildInputs = [ olm ];
|
||||
|
||||
vendorHash = "sha256-5Vg7aUkqiFIQuxmsDOJjvXoeA5NjMoBoD0XBhC+o4GA=";
|
||||
|
||||
doCheck = false;
|
||||
|
||||
passthru.tests.go-neb = nixosTests.go-neb;
|
||||
|
||||
meta = {
|
||||
broken = stdenv.hostPlatform.isDarwin;
|
||||
description = "Extensible matrix bot written in Go";
|
||||
mainProgram = "go-neb";
|
||||
homepage = "https://github.com/matrix-org/go-neb";
|
||||
license = lib.licenses.asl20;
|
||||
maintainers = with lib.maintainers; [
|
||||
hexa
|
||||
maralorn
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -1041,6 +1041,7 @@ mapAliases {
|
||||
gns3Packages = throw "'gns3Packages' has been removed. Use 'gns3-gui' and 'gns3-server' instead."; # Added 2026-01-18
|
||||
gnu-cobol = throw "'gnu-cobol' has been renamed to/replaced by 'gnucobol'"; # Converted to throw 2025-10-27
|
||||
gnubik = throw "'gnubik' has been removed due to lack of maintenance upstream and its dependency on GTK 2"; # Added 2025-09-16
|
||||
go-neb = throw "'go-neb' has been removed because upstream discontinued and archived the project; use matrix-hookshot or another maintained Matrix bot instead."; # Added 2026-09-02
|
||||
go-thumbnailer = throw "'go-thumbnailer' has been renamed to/replaced by 'thud'"; # Converted to throw 2025-10-27
|
||||
go-upower-notify = throw "'go-upower-notify' has been renamed to/replaced by 'upower-notify'"; # Converted to throw 2025-10-27
|
||||
go_1_23 = throw "Go 1.23 is end-of-life and 'go_1_23' has been removed. Please use a newer Go toolchain."; # Added 2025-08-13
|
||||
|
||||
Reference in New Issue
Block a user