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 247433d commit 37e217c
Showing 1 changed file with 28 additions and 21 deletions.
49 changes: 28 additions & 21 deletions modules/flake-parts/nixosConfigurations.turn-3/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,7 @@
pkgs,
...
}:
let
hostName = "turn-3";

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

signalIpv4 = "95.217.241.142";
signalFqdn = "signal-3.infra.holochain.org";

bootstrapIpv4 = "65.109.242.243";
bootstrapFqdn = "bootstrap-3.infra.holochain.org";
in
{
imports = [
inputs.disko.nixosModules.disko
Expand All @@ -38,9 +27,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-3";

primaryIpv4 = "65.21.54.162";

hostName = turnIpv4;
turnIpv4 = config.passthru.primaryIpv4;
signalIpv4 = "95.217.241.142";
bootstrapIpv4 = "65.109.242.243";

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

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

nix.settings.max-jobs = 8;

Expand All @@ -53,16 +60,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 +81,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 +101,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 37e217c

Please sign in to comment.