Skip to content

Commit

Permalink
fixup! refactor(specialArgs,nixosConfigurations/*): use config.passthru
Browse files Browse the repository at this point in the history
  • Loading branch information
steveej committed Oct 4, 2024
1 parent a5f283a commit 247433d
Showing 1 changed file with 28 additions and 22 deletions.
50 changes: 28 additions & 22 deletions modules/flake-parts/nixosConfigurations.turn-2/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,6 @@
pkgs,
...
}:
let
hostName = "turn-2";

turnIpv4 = "65.109.140.0";
turnFqdn = "${hostName}.infra.holochain.org";

signalIpv4 = "95.217.25.40";
signalFqdn = "signal-2.infra.holochain.org";

bootstrapIpv4 = "95.216.176.124";
bootstrapFqdn = "bootstrap-2.infra.holochain.org";
in
{
imports = [
inputs.disko.nixosModules.disko
Expand All @@ -38,9 +26,27 @@ in
self.nixosModules.kitsune-bootstrap
];

networking.hostName = hostName; # Define your hostname.
passthru = {
fqdn = "${config.passthru.hostName}.${config.passthru.domain}";

domain = self.specialArgs.infraDomain;
hostName = "turn-2";

primaryIpv4 = "65.109.140.0";

hostName = turnIpv4;
turnIpv4 = config.passthru.primaryIpv4;
signalIpv4 = "95.217.25.40";
bootstrapIpv4 = "95.216.176.124";

turnFqdn = "${config.passthru.hostName}.${config.passthru.domain}";
signalFqdn = "signal-2.${config.passthru.domain}";
bootstrapFqdn = "bootstrap-2.${config.passthru.domain}";
};

hostName = config.passthru.primaryIpv4;
networking = {
inherit (config.passthru) hostName domain;
};

nix.settings.max-jobs = 8;

Expand All @@ -53,16 +59,16 @@ in
# FIXME: is there a better way to do this?
environment.etc."systemd/network/10-cloud-init-eth0.network.d/00-floating-ips.conf".text = ''
[Network]
Address = ${signalIpv4}/32
Address = ${bootstrapIpv4}/32
Address = ${config.passthru.signalIpv4}/32
Address = ${config.passthru.bootstrapIpv4}/32
'';

system.stateVersion = "23.11";

services.holochain-turn-server = {
enable = true;
url = turnFqdn;
address = turnIpv4;
url = config.passthru.turnFqdn;
address = config.passthru.turnIpv4;
username = "test";
credential = "test";
verbose = false;
Expand All @@ -74,10 +80,10 @@ in

services.tx5-signal-server = {
enable = true;
address = signalIpv4;
address = config.passthru.signalIpv4;
port = 8443;
tls-port = 443;
url = signalFqdn;
url = config.passthru.signalFqdn;
iceServers = [
{ urls = [ "stun:${config.services.holochain-turn-server.url}:80" ]; }
{
Expand All @@ -94,9 +100,9 @@ in

services.kitsune-bootstrap = {
enable = true;
address = bootstrapIpv4;
address = config.passthru.bootstrapIpv4;
port = 8444;
tls-port = 443;
url = bootstrapFqdn;
url = config.passthru.bootstrapFqdn;
};
}

0 comments on commit 247433d

Please sign in to comment.