containers/fluorite: fixup multiple hosts
Some checks are pending
CI / Build linux-lava for x86_64-linux (push) Waiting to run
Some checks are pending
CI / Build linux-lava for x86_64-linux (push) Waiting to run
This commit is contained in:
parent
0d89b2a64f
commit
042a04cbfc
1 changed files with 10 additions and 5 deletions
|
|
@ -6,7 +6,6 @@
|
||||||
let
|
let
|
||||||
name = "fluorite";
|
name = "fluorite";
|
||||||
fqdn = "fluorite.lava.moe";
|
fqdn = "fluorite.lava.moe";
|
||||||
altfqdn = hostname: "fluorite.${hostname}.lava.moe";
|
|
||||||
subnetId = "6";
|
subnetId = "6";
|
||||||
|
|
||||||
subnet = x: "fd0d:1::${subnetId}:${toString x}";
|
subnet = x: "fd0d:1::${subnetId}:${toString x}";
|
||||||
|
|
@ -28,7 +27,13 @@
|
||||||
nixosConfigurations.container = nixpkgs.lib.nixosSystem {
|
nixosConfigurations.container = nixpkgs.lib.nixosSystem {
|
||||||
inherit modules;
|
inherit modules;
|
||||||
};
|
};
|
||||||
nixosModule = { config, ... }: {
|
nixosModule = { config, ... }: let
|
||||||
|
altfqdn = "fluorite.${config.networking.hostName}.lava.moe";
|
||||||
|
# TODO: HACK
|
||||||
|
listenAddr = if (config.networking.hostName == "alyssum")
|
||||||
|
then [ "100.67.2.1" ]
|
||||||
|
else [ "10.0.0.1" "[fd0d::1]" "100.67.1.1" ];
|
||||||
|
in {
|
||||||
networking.nat = {
|
networking.nat = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableIPv6 = true;
|
enableIPv6 = true;
|
||||||
|
|
@ -40,14 +45,14 @@
|
||||||
useACMEHost = "lava.moe";
|
useACMEHost = "lava.moe";
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
locations."/".proxyPass = "http://[${client}]:5030";
|
locations."/".proxyPass = "http://[${client}]:5030";
|
||||||
listenAddresses = [ "10.0.0.1" "[fd0d::1]" "100.67.1.1" ];
|
listenAddresses = listenAddr;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nginx.virtualHosts."${altfqdn config.networking.hostName}" = {
|
services.nginx.virtualHosts."${altfqdn}" = {
|
||||||
useACMEHost = "lava.moe";
|
useACMEHost = "lava.moe";
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
locations."/".proxyPass = "http://[${client}]:5030";
|
locations."/".proxyPass = "http://[${client}]:5030";
|
||||||
listenAddresses = [ "10.0.0.1" "[fd0d::1]" "100.67.1.1" ];
|
listenAddresses = listenAddr;
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.tmpfiles.rules = [
|
systemd.tmpfiles.rules = [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue