mirror of
https://git.sr.ht/~magic_rb/cluster
synced 2024-11-22 08:04:20 +01:00
wip
Signed-off-by: main <magic_rb@redalder.org>
This commit is contained in:
parent
a27a4c4e78
commit
4b6de9e74d
|
@ -1,7 +1,7 @@
|
|||
{ nglib, nixpkgs }:
|
||||
nglib.makeSystem {
|
||||
system = "x86_64-linux";
|
||||
name = "nixng-gitea";
|
||||
name = "synapse";
|
||||
inherit nixpkgs;
|
||||
config = ({ pkgs, ... }:
|
||||
{
|
||||
|
|
40
containers/heisenbridge.nix
Normal file
40
containers/heisenbridge.nix
Normal file
|
@ -0,0 +1,40 @@
|
|||
{ nglib, nixpkgs }:
|
||||
nglib.makeSystem {
|
||||
system = "x86_64-linux";
|
||||
name = "heisenbridge";
|
||||
inherit nixpkgs;
|
||||
config = ({ pkgs, ... }:
|
||||
{
|
||||
dumb-init = {
|
||||
enable = true;
|
||||
type.services = { };
|
||||
};
|
||||
|
||||
init.services.heisenbridge = {
|
||||
enabled = true;
|
||||
shutdownOnExit = true;
|
||||
script =
|
||||
let
|
||||
config =
|
||||
''
|
||||
-l 127.0.0.1 \
|
||||
-p 9898 \
|
||||
-o @magic_rb:matrix.redalder.org \
|
||||
'';
|
||||
in
|
||||
pkgs.writeShellScript "heisenbridge"
|
||||
''
|
||||
REGISTRATION_FILE="/var/lib/registrations/heisenbridge.yaml"
|
||||
|
||||
[ -e "$REGISTRATION_FILE" ] || \
|
||||
${pkgs.heisenbridge}/bin/heisenbridge \
|
||||
-c "$REGISTRATION_FILE" \
|
||||
${config} \
|
||||
--generate
|
||||
${pkgs.heisenbridge}/bin/heisenbridge \
|
||||
-c "$REGISTRATION_FILE" \
|
||||
${config}
|
||||
'';
|
||||
};
|
||||
});
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
{ nglib, nixpkgs }:
|
||||
nglib.makeSystem {
|
||||
system = "x86_64-linux";
|
||||
name = "nixng-gitea";
|
||||
name = "mautrix-facebook";
|
||||
inherit nixpkgs;
|
||||
config = ({ pkgs, ... }:
|
||||
{
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
baikal = import ./containers/baikal.nix base;
|
||||
conduit = import ./containers/conduit.nix base;
|
||||
mautrix-facebook = import ./containers/mautrix-facebook.nix base;
|
||||
heisenbridge = import ./containers/heisenbridge.nix base;
|
||||
};
|
||||
|
||||
hydraJobs =
|
||||
|
|
|
@ -95,8 +95,60 @@ EOF
|
|||
}
|
||||
|
||||
resources {
|
||||
cpu = 500
|
||||
memory = 1024
|
||||
cpu = 256
|
||||
memory = 256
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group "heisenbridge" {
|
||||
count = 1
|
||||
|
||||
volume "matrix-registrations" {
|
||||
type = "csi"
|
||||
source = "matrix-registrations"
|
||||
read_only = false
|
||||
|
||||
attachment_mode = "file-system"
|
||||
access_mode = "multi-node-multi-writer"
|
||||
}
|
||||
|
||||
restart {
|
||||
attempts = 5
|
||||
delay = "5s"
|
||||
}
|
||||
|
||||
network {
|
||||
mode = "bridge"
|
||||
}
|
||||
|
||||
service {
|
||||
name = "matrix-heisenbridge"
|
||||
port = "9898"
|
||||
|
||||
connect {
|
||||
sidecar_service {}
|
||||
}
|
||||
}
|
||||
|
||||
task "heisenbridge" {
|
||||
driver = "containerd-driver"
|
||||
|
||||
volume_mount {
|
||||
volume = "matrix-registrations"
|
||||
destination = "/var/lib/registrations"
|
||||
read_only = false
|
||||
}
|
||||
|
||||
config {
|
||||
flake_ref = "${var.flake_ref}#nixngSystems.registrations.config.system.build.toplevel"
|
||||
flake_sha = var.flake_sha
|
||||
entrypoint = [ "init" ]
|
||||
}
|
||||
|
||||
resources {
|
||||
cpu = 128
|
||||
memory = 128
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -151,6 +203,11 @@ EOF
|
|||
destination_name = "matrix-mautrix-facebook"
|
||||
local_bind_port = 29319
|
||||
}
|
||||
|
||||
upstreams {
|
||||
destination_name = "matrix-heisenbridge"
|
||||
local_bind_port = 9898
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -179,7 +236,7 @@ EOF
|
|||
|
||||
resources {
|
||||
cpu = 2048
|
||||
memory = 4096
|
||||
memory = 2048
|
||||
}
|
||||
|
||||
vault {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
flake_rev = "e7216e601a70f595893971d8b6f2296f3e867269"
|
||||
flake_rev = "a27a4c4e78928564383e165b3868aa4f63c451df"
|
||||
flake_ref = "conduit-wip"
|
||||
flake_host = "git+https://git.sr.ht/~magic_rb/cluster"
|
||||
flake_host_alt = "git+https://git.sr.ht/~magic_rb/cluster"
|
||||
flake_sha = "sha256-RJDAmsZJjBVvbYBG1vP5Se+i3n2IO3E2Y5fWFFmQ7lQ="
|
||||
flake_sha = "sha256-7b/9W8mDnqQv0DfH6if0IVbMWR8iEvor7Ktth/WkX9M="
|
||||
|
||||
|
|
Loading…
Reference in a new issue