diff --git a/containers/mautrix-facebook.nix b/containers/mautrix-facebook.nix index c10ee37..9aed8af 100644 --- a/containers/mautrix-facebook.nix +++ b/containers/mautrix-facebook.nix @@ -21,12 +21,17 @@ nglib.makeSystem { '' DATA_DIR="/var/lib/mautrix-facebook" CONFIG_FILE="$DATA_DIR/config.yaml" + REGISTRATION_FILE="$DATA_DIR/registration.yaml" DB_FILE="$DATA_DIR/sqlite.db" + cp ${config} "$CONFIG_FILE" ; chmod 755 "$CONFIG_FILE" ${pkgs.sqlite}/bin/sqlite3 $DB_FILE '.databases ; .quit' - [ -e -r $NOMAD_ALLOC_DIR/registration.yaml ] || \ - ${pkgs.mautrix-facebook}/bin/mautrix-facebook -c "$CONFIG_FILE" -r $NOMAD_ALLOC_DIR/registration.yaml -g - ${pkgs.mautrix-facebook}/bin/mautrix-facebook -c "$CONFIG_FILE" -r $NOMAD_ALLOC_DIR/registration.yaml -n + + [ -e "$REGISTRATION_FILE" ] || \ + ${pkgs.mautrix-facebook}/bin/mautrix-facebook -c "$CONFIG_FILE" -r "$REGISTRATION_FILE" -g + cp "$REGISTRATION_FILE" $NOMAD_TASK_DIR/registration.yaml + + ${pkgs.mautrix-facebook}/bin/mautrix-facebook -c "$CONFIG_FILE" -r "$REGISTRATION_FILE" -n ''; }; });