feat: better handling if ip and networking

This commit is contained in:
silver 2023-01-17 17:20:22 +00:00
parent c2e4fde98d
commit 3d2efa3b8a

View file

@ -1,25 +1,50 @@
{ pkgs, lib, nodes, ... }: { { pkgs, lib, nodes, ... }:
let
# ip = "193.1.99.72";
ip = "192.168.1.157";
ip_priv = "172.20.20.1";
# hostname = "agentjones.skynet.ie";
hostname = "192.168.1.157";
in {
imports = [ imports = [
# applications for this particular server # applications for this particular server
../applications/firewall.nix ../applications/firewall.nix
]; ];
deployment = { deployment = {
#targetHost = "agentjones.skynet.ie"; targetHost = hostname;
# wont have dns to start with
#targetHost = "193.1.99.72";
targetHost = "192.168.1.157";
targetPort = 22; targetPort = 22;
targetUser = "root"; targetUser = "root";
}; };
# this has to be defined for any physical servers
# vms are defined by teh vm host
networking.interfaces = {
eth0 = {
ipv4.addresses = [
{
address = "${ip}/32";
prefixLength = 24;
}
];
};
priv0 = {
ipv4.addresses = [
{
address = "${ip_priv}/32";
prefixLength = 24;
}
];
};
};
# this server is teh firewall # this server is teh firewall
skynet_firewall = { skynet_firewall = {
# always good to know oneself # always good to know oneself
own = { own = {
#ip = "193.1.99.72"; ip = ip;
ip = "192.168.1.157";
ports = { ports = {
tcp = [ tcp = [