2023-05-16 21:23:04 +00:00
|
|
|
/*
|
|
|
|
|
|
|
|
Name: https://en.wikipedia.org/wiki/KITT
|
|
|
|
Why: Kitt used to have this role before (as well as email and dns)
|
|
|
|
Type: VM
|
|
|
|
Hardware: -
|
|
|
|
From: 2023
|
|
|
|
Role: LDAP Server
|
|
|
|
Notes:
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2023-05-19 17:21:33 +00:00
|
|
|
{ pkgs, lib, nodes, ... }:
|
2023-05-16 21:23:04 +00:00
|
|
|
let
|
|
|
|
# name of the server, sets teh hostname and record for it
|
|
|
|
name = "kitt";
|
|
|
|
ip_pub = "193.1.99.74";
|
|
|
|
ip_priv = "172.20.20.5";
|
|
|
|
hostname = "${name}.skynet.ie";
|
2023-05-19 17:21:33 +00:00
|
|
|
#hostname = ip_pub;
|
2023-05-16 21:23:04 +00:00
|
|
|
|
|
|
|
in {
|
|
|
|
imports = [
|
|
|
|
# required imports
|
|
|
|
../applications/firewall.nix
|
|
|
|
../applications/dns.nix
|
|
|
|
|
|
|
|
# whats running on teh server
|
|
|
|
../applications/ldap.nix
|
|
|
|
];
|
|
|
|
|
|
|
|
deployment = {
|
|
|
|
targetHost = hostname;
|
|
|
|
targetPort = 22;
|
|
|
|
targetUser = "root";
|
2023-06-15 13:30:18 +00:00
|
|
|
|
|
|
|
tags = [ "active" ];
|
2023-05-16 21:23:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# add this server to dns
|
2023-05-21 18:05:47 +00:00
|
|
|
skynet_dns.records = {
|
|
|
|
external = [
|
|
|
|
"${name} A ${ip_pub}"
|
|
|
|
];
|
|
|
|
reverse = [
|
|
|
|
"${builtins.substring 9 3 ip_pub} IN PTR ${name}"
|
|
|
|
];
|
|
|
|
};
|
2023-05-16 21:23:04 +00:00
|
|
|
|
|
|
|
# we use this to pass in teh relevent infomation to the
|
|
|
|
services.skynet_ldap = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
host = {
|
|
|
|
# pass in teh ip (used for firewall)
|
|
|
|
ip = ip_pub;
|
|
|
|
|
|
|
|
# the name is used for dns
|
|
|
|
name = name;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|