nixos/machines/skynet.nix

86 lines
1.7 KiB
Nix
Raw Normal View History

2023-07-20 21:05:46 +00:00
/*
Name: https://en.wikipedia.org/wiki/Skynet_(Terminator)
Why: Skynet is eternal
Type: VM
Hardware: -
From: 2023
Role: Webserver and member linux box
Notes: Does not host offical sites
2023-07-20 21:05:46 +00:00
*/
2023-07-21 20:27:01 +00:00
{ pkgs, lib, nodes, inputs, ... }:
2023-07-20 21:05:46 +00:00
let
name = "skynet";
# DMZ that ITD provided
ip_pub = "193.1.96.165";
2023-09-15 23:30:45 +00:00
ip_int = "193.1.99.81";
2023-07-20 21:05:46 +00:00
hostname = "${name}.skynet.ie";
in {
2023-07-21 01:03:04 +00:00
imports = [
../applications/skynet_users.nix
2023-07-21 01:03:04 +00:00
];
2023-07-20 21:05:46 +00:00
deployment = {
targetHost = ip_pub;
2023-07-20 21:05:46 +00:00
targetPort = 22;
targetUser = "root";
# this one is manually deployed
tags = [ "active-ext" ];
2023-07-20 21:05:46 +00:00
};
skynet_dns.records = [
{record=name; r_type="A"; value=ip_pub; server=true;}
{record=ip_pub; r_type="PTR"; value=hostname;}
2023-07-20 21:05:46 +00:00
];
services.skynet_backup.host = {
ip = ip_pub;
name = name;
2023-07-20 21:05:46 +00:00
};
2023-07-21 01:03:04 +00:00
proxmoxLXC.manageNetwork = true;
networking = {
hostName = name;
# needed to use the dmz first
defaultGateway = lib.mkForce "193.1.96.161";
interfaces = {
# need it for dns validation for letsencrypt
eth0.ipv4 = {
addresses = [
{
address = ip_int;
prefixLength = 26;
}
];
routes = [
{
2023-09-15 23:30:45 +00:00
# need to be able to get to the dns server
address = "193.1.99.120";
prefixLength = 26;
via = "193.1.99.65";
}
];
};
# primary ip for logging in
eth1.ipv4.addresses = [
{
address = ip_pub;
prefixLength = 28;
}
];
};
};
2023-07-21 01:03:04 +00:00
services.skynet_users = {
host = {
ip = ip_pub;
name = name;
};
};
2023-07-20 21:05:46 +00:00
}