feat: use a host attribute to make the config less verbose/complex

This commit is contained in:
silver 2024-05-30 14:11:45 +01:00
parent e156b4ecaf
commit 54b43c9962
Signed by: silver
GPG key ID: 54E2C71918E93B74
14 changed files with 81 additions and 102 deletions

View file

@ -17,6 +17,10 @@ Notes: Used to have Agent Smith as a partner but it died (Ironically)
name = "agentjones"; name = "agentjones";
ip_pub = "193.1.99.72"; ip_pub = "193.1.99.72";
hostname = "${name}.skynet.ie"; hostname = "${name}.skynet.ie";
host = {
ip = ip_pub;
name = name;
};
in { in {
imports = [ imports = [
./hardware/RM001.nix ./hardware/RM001.nix
@ -46,10 +50,7 @@ in {
]; ];
services.skynet.backup = { services.skynet.backup = {
host = { host = host;
ip = ip_pub;
name = name;
};
}; };
# keep the wired usb connection alive (front panel) # keep the wired usb connection alive (front panel)

View file

@ -18,6 +18,10 @@ Notes:
name = "cadie"; name = "cadie";
ip_pub = "193.1.99.77"; ip_pub = "193.1.99.77";
hostname = "${name}.skynet.ie"; hostname = "${name}.skynet.ie";
host = {
ip = ip_pub;
name = name;
};
in { in {
imports = [ imports = [
../applications/nextcloud.nix ../applications/nextcloud.nix
@ -46,18 +50,12 @@ in {
]; ];
services.skynet.backup = { services.skynet.backup = {
host = { host = host;
ip = ip_pub;
name = name;
};
}; };
services.skynet_nextcloud = { services.skynet_nextcloud = {
enable = true; enable = true;
host = { host = host;
ip = ip_pub;
name = name;
};
}; };
# this was causing a conflict for some reason # this was causing a conflict for some reason

View file

@ -18,6 +18,10 @@ Notes:
name = "earth"; name = "earth";
ip_pub = "193.1.99.79"; ip_pub = "193.1.99.79";
hostname = "${name}.skynet.ie"; hostname = "${name}.skynet.ie";
host = {
ip = ip_pub;
name = name;
};
in { in {
imports = [ imports = [
../applications/skynet.ie.nix ../applications/skynet.ie.nix
@ -47,16 +51,10 @@ in {
]; ];
services.skynet.backup = { services.skynet.backup = {
host = { host = host;
ip = ip_pub;
name = name;
};
}; };
services.skynet = { services.skynet = {
host = { host = host;
ip = ip_pub;
name = name;
};
}; };
} }

View file

@ -19,6 +19,10 @@ Notes:
name = "galatea"; name = "galatea";
ip_pub = "193.1.99.111"; ip_pub = "193.1.99.111";
hostname = "${name}.skynet.ie"; hostname = "${name}.skynet.ie";
host = {
ip = ip_pub;
name = name;
};
in { in {
imports = [ imports = [
../applications/ulfm.nix ../applications/ulfm.nix
@ -47,17 +51,11 @@ in {
]; ];
services.skynet.backup = { services.skynet.backup = {
host = { host = host;
ip = ip_pub;
name = name;
};
}; };
services.skynet_ulfm = { services.skynet_ulfm = {
enable = true; enable = true;
host = { host = host;
ip = ip_pub;
name = name;
};
}; };
} }

View file

@ -18,7 +18,10 @@ Notes:
name = "gir"; name = "gir";
ip_pub = "193.1.99.76"; ip_pub = "193.1.99.76";
hostname = "${name}.skynet.ie"; hostname = "${name}.skynet.ie";
#hostname = ip_pub; host = {
ip = ip_pub;
name = name;
};
in { in {
imports = [ imports = [
../applications/email.nix ../applications/email.nix
@ -48,19 +51,13 @@ in {
]; ];
services.skynet.backup = { services.skynet.backup = {
host = { host = host;
ip = ip_pub;
name = name;
};
}; };
# we use this to pass in teh relevent infomation to the # we use this to pass in teh relevent infomation to the
services.skynet_email = { services.skynet_email = {
enable = true; enable = true;
host = { host = host;
ip = ip_pub;
name = name;
};
domain = "skynet.ie"; domain = "skynet.ie";
}; };
} }

View file

@ -19,6 +19,10 @@ Notes: Each user has roughly 20gb os storage
name = "glados"; name = "glados";
ip_pub = "193.1.99.75"; ip_pub = "193.1.99.75";
hostname = "${name}.skynet.ie"; hostname = "${name}.skynet.ie";
host = {
ip = ip_pub;
name = name;
};
in { in {
imports = [ imports = [
../applications/gitlab.nix ../applications/gitlab.nix
@ -47,17 +51,11 @@ in {
]; ];
services.skynet.backup = { services.skynet.backup = {
host = { host = host;
ip = ip_pub;
name = name;
};
}; };
services.skynet_gitlab = { services.skynet_gitlab = {
enable = true; enable = true;
host = { host = host;
ip = ip_pub;
name = name;
};
}; };
} }

View file

@ -19,7 +19,10 @@ Notes:
name = "kitt"; name = "kitt";
ip_pub = "193.1.99.74"; ip_pub = "193.1.99.74";
hostname = "${name}.skynet.ie"; hostname = "${name}.skynet.ie";
#hostname = ip_pub; host = {
ip = ip_pub;
name = name;
};
in { in {
imports = [ imports = [
../applications/ldap/server.nix ../applications/ldap/server.nix
@ -54,18 +57,12 @@ in {
]; ];
services.skynet.backup = { services.skynet.backup = {
host = { host = host;
ip = ip_pub;
name = name;
};
}; };
services.skynet_ldap = { services.skynet_ldap = {
enable = true; enable = true;
host = { host = host;
ip = ip_pub;
name = name;
};
}; };
services.discord_bot = { services.discord_bot = {
@ -75,27 +72,18 @@ in {
services.skynet_vaultwarden = { services.skynet_vaultwarden = {
enable = true; enable = true;
host = { host = host;
ip = ip_pub;
name = name;
};
}; };
services.skynet.prometheus = { services.skynet.prometheus = {
server = { server = {
enable = true; enable = true;
host = { host = host;
ip = ip_pub;
name = name;
};
}; };
}; };
services.skynet.grafana = { services.skynet.grafana = {
enable = true; enable = true;
host = { host = host;
ip = ip_pub;
name = name;
};
}; };
} }

View file

@ -17,6 +17,10 @@ Notes:
name = "marvin"; name = "marvin";
ip_pub = "193.1.99.81"; ip_pub = "193.1.99.81";
hostname = "${name}.skynet.ie"; hostname = "${name}.skynet.ie";
host = {
ip = ip_pub;
name = name;
};
groups = [ groups = [
"skynet-admins-linux" "skynet-admins-linux"
@ -64,10 +68,7 @@ in {
]; ];
services.skynet.backup = { services.skynet.backup = {
host = { host = host;
ip = ip_pub;
name = name;
};
}; };
# Put test services below this # Put test services below this

View file

@ -18,6 +18,10 @@ Notes:
name = "neuromancer"; name = "neuromancer";
ip_pub = "193.1.99.80"; ip_pub = "193.1.99.80";
hostname = "${name}.skynet.ie"; hostname = "${name}.skynet.ie";
host = {
ip = ip_pub;
name = name;
};
in { in {
imports = [ imports = [
./hardware/RM007.nix ./hardware/RM007.nix
@ -60,9 +64,6 @@ in {
services.skynet.backup = { services.skynet.backup = {
server.enable = true; server.enable = true;
host = { host = host;
ip = ip_pub;
name = name;
};
}; };
} }

View file

@ -19,6 +19,10 @@ Notes:
name = "optimus"; name = "optimus";
ip_pub = "193.1.99.112"; ip_pub = "193.1.99.112";
hostname = "${name}.skynet.ie"; hostname = "${name}.skynet.ie";
host = {
ip = ip_pub;
name = name;
};
in { in {
imports = [ imports = [
../applications/games.nix ../applications/games.nix
@ -47,17 +51,11 @@ in {
]; ];
services.skynet.backup = { services.skynet.backup = {
host = { host = host;
ip = ip_pub;
name = name;
};
}; };
services.skynet_games = { services.skynet_games = {
enable = true; enable = true;
host = { host = host;
ip = ip_pub;
name = name;
};
}; };
} }

View file

@ -21,6 +21,10 @@ Notes: Does not host offical sites
# for internal network connectivity # for internal network connectivity
ip_int = "193.1.99.82"; ip_int = "193.1.99.82";
hostname = "${name}.skynet.ie"; hostname = "${name}.skynet.ie";
host = {
ip = ip_pub;
name = name;
};
in { in {
imports = [ imports = [
../applications/skynet_users.nix ../applications/skynet_users.nix
@ -49,15 +53,9 @@ in {
} }
]; ];
services.skynet.backup.host = { services.skynet.backup.host = host;
ip = ip_pub;
name = name;
};
services.skynet_users = { services.skynet_users = {
host = { host = host;
ip = ip_pub;
name = name;
};
}; };
} }

View file

@ -18,6 +18,10 @@ Notes: Using the server that used to be called Earth
name = "vendetta"; name = "vendetta";
ip_pub = "193.1.99.120"; ip_pub = "193.1.99.120";
hostname = "${name}.skynet.ie"; hostname = "${name}.skynet.ie";
host = {
ip = ip_pub;
name = name;
};
in { in {
imports = [ imports = [
./hardware/RM002.nix ./hardware/RM002.nix
@ -46,10 +50,7 @@ in {
}; };
services.skynet.backup = { services.skynet.backup = {
host = { host = host;
ip = ip_pub;
name = name;
};
}; };
services.skynet.dns = { services.skynet.dns = {

View file

@ -17,6 +17,10 @@ Notes:
name = "vigil"; name = "vigil";
ip_pub = "193.1.99.109"; ip_pub = "193.1.99.109";
hostname = "${name}.skynet.ie"; hostname = "${name}.skynet.ie";
host = {
ip = ip_pub;
name = name;
};
in { in {
imports = [ imports = [
]; ];
@ -30,10 +34,7 @@ in {
}; };
services.skynet.backup = { services.skynet.backup = {
host = { host = host;
ip = ip_pub;
name = name;
};
}; };
services.skynet.dns = { services.skynet.dns = {

View file

@ -18,6 +18,10 @@ Notes:
name = "wheatly"; name = "wheatly";
ip_pub = "193.1.99.78"; ip_pub = "193.1.99.78";
hostname = "${name}.skynet.ie"; hostname = "${name}.skynet.ie";
host = {
ip = ip_pub;
name = name;
};
in { in {
imports = [ imports = [
../applications/gitlab_runner.nix ../applications/gitlab_runner.nix
@ -46,10 +50,7 @@ in {
]; ];
services.skynet.backup = { services.skynet.backup = {
host = { host = host;
ip = ip_pub;
name = name;
};
}; };
services.skynet_gitlab_runner = { services.skynet_gitlab_runner = {