nixos/machines/marvin.nix

119 lines
1.9 KiB
Nix
Raw Normal View History

/*
Name: https://en.wikipedia.org/wiki/Marvin_the_Paranoid_Android
Why: Has terrible pain in all the diodes down its left side
Type: VM
Hardware: -
From: 2023
Role: For trainees.
Notes:
*/
{
pkgs,
config,
lib,
nodes,
...
}: let
name = "marvin";
ip_pub = "193.1.99.81";
hostname = "${name}.skynet.ie";
groups = [
"skynet-admins-linux"
"skynet-trainees-linux"
];
groups_trusted = map (x: "@${x}") groups;
in {
imports = [
2024-05-21 01:23:10 +00:00
../applications/grafana.nix
../applications/prometheus.nix
];
deployment = {
targetHost = hostname;
targetPort = 22;
targetUser = null;
# not deployed automatically as its a test server
tags = [];
};
# allow trainees to deploy
nix.settings.trusted-users =
[
"root"
]
++ groups_trusted;
# allow trainees access
services.skynet_ldap_client = {
groups = groups;
sudo_groups = groups;
};
services.skynet.prometheus.server = {
host = {
ip = ip_pub;
name = name;
};
port = 9001;
servers = [
"agentjones"
"cadie"
"earth"
"galatea"
"gir"
"glados"
"kitt"
"marvin"
"neuromancer"
"optimus"
"skynet"
"vendetta"
"vigil"
"wheatly"
];
};
2024-05-21 01:23:10 +00:00
services.skynet.grafana = {
enable = true;
host = {
ip = ip_pub;
name = name;
};
2024-05-21 06:32:25 +00:00
# maybe just do provision config directly ?
datasource = {
name = "Prometheus";
url = "localhost:${toString config.services.prometheus.port}";
};
2024-05-21 01:23:10 +00:00
};
skynet_dns.records = [
{
record = name;
r_type = "A";
value = ip_pub;
server = true;
}
{
record = ip_pub;
r_type = "PTR";
value = hostname;
}
];
services.skynet_backup = {
host = {
ip = ip_pub;
name = name;
};
};
# Put test services below this
}