nixos/machines/galatea.nix

71 lines
1.7 KiB
Nix
Raw Normal View History

2023-01-25 11:48:44 +00:00
/*
Name: https://en.wikipedia.org/wiki/Galatea_(mythology)
Why: Created as a product of artistic expression
Type: VM
Hardware: -
From: 2023
Role: Icecast server for ULFM
Notes:
*/
{ pkgs, lib, nodes, config, ... }:
let
# name of the server, sets teh hostname and record for it
name = "galatea";
ip_pub = "193.1.99.111";
ip_priv = "172.20.20.6";
hostname = "${name}.skynet.ie";
2023-01-25 11:48:44 +00:00
# dosent seem to be any otehr way to have it like read from a file
feck = "d9J4jDsJPuMPUMAAE4J4tH37HsmxEDze";
in {
imports = [
2023-04-21 00:22:16 +00:00
# general stuff for config
2023-01-25 11:48:44 +00:00
../applications/firewall.nix
../applications/dns.nix
2023-04-21 00:22:16 +00:00
# web stuff
../applications/nginx.nix
#../applications/acme.nix
# specific to tis server
2023-01-25 11:48:44 +00:00
];
deployment = {
targetHost = hostname;
targetPort = 22;
targetUser = "root";
2023-04-21 00:22:16 +00:00
tags = [ "active" ];
2023-01-25 11:48:44 +00:00
};
# these two are to be able to add the rules for firewall and dns
# open the firewall for this
skynet_firewall.forward = [
"ip daddr ${ip_pub} tcp dport 80 counter packets 0 bytes 0 accept"
"ip daddr ${ip_pub} tcp dport 443 counter packets 0 bytes 0 accept"
"ip daddr ${ip_pub} tcp dport 8000 counter packets 0 bytes 0 accept"
2023-01-25 11:48:44 +00:00
];
skynet_dns.records = {
external = [
"${name} A ${ip_pub}"
];
cname = [
# this is also the stream server
2023-04-21 00:22:16 +00:00
#"stream CNAME ${name}"
"ulfm CNAME ${name}"
2023-01-25 11:48:44 +00:00
];
};
2023-04-21 00:22:16 +00:00
networking.firewall.allowedTCPPorts = [ 8000 ];
2023-01-25 11:48:44 +00:00
2023-04-21 00:22:16 +00:00
services = {
nginx.virtualHosts."ulfm.skynet.ie" = {
#forceSSL = true;
#useACMEHost = "skynet";
# locations."/gw2".proxyPass = "http://localhost:8085";
2023-01-25 11:48:44 +00:00
};
};
}