mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-12-04 22:14:58 +01:00
aff0158ef7
Signed-off-by: magic_rb <magic_rb@redalder.org>
38 lines
1 KiB
Nix
38 lines
1 KiB
Nix
{inputs, ...}: {
|
|
flake.nixngConfigurations.heisenbridge = inputs.nixng.nglib.makeSystem {
|
|
system = "x86_64-linux";
|
|
name = "heisenbridge";
|
|
inherit (inputs) nixpkgs;
|
|
config = {
|
|
pkgs,
|
|
lib,
|
|
...
|
|
}: let
|
|
inherit
|
|
(lib)
|
|
getExe'
|
|
;
|
|
in {
|
|
dumb-init = {
|
|
enable = true;
|
|
type.services = {};
|
|
};
|
|
|
|
init.services.heisenbridge = {
|
|
enabled = true;
|
|
# heisenbridge needs to retry the connection and task restarting does not work currently
|
|
shutdownOnExit = false;
|
|
script = pkgs.writeShellScript "heisenbridge" ''
|
|
REGISTRATION_FILE="/var/lib/registrations/heisenbridge.yaml"
|
|
|
|
${getExe' pkgs.heisenbridge "heisenbridge"} 'https://matrix.redalder.org/' \
|
|
-c "$REGISTRATION_FILE" \
|
|
$([ -e "$REGISTRATION_FILE" ] || echo "--generate") \
|
|
-l 127.0.0.1 \
|
|
-p 9898 \
|
|
-o @magic_rb:matrix.redalder.org
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
}
|