config/hosts/fra1-a/configuration.nix

139 lines
3.1 KiB
Nix
Raw Normal View History

2023-08-26 07:18:27 +03:00
{
config,
myData,
modulesPath,
...
2024-07-29 15:39:54 +03:00
}:
{
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
2023-08-26 07:18:27 +03:00
zfs-root = {
boot = {
enable = true;
devNodes = "/dev/disk/by-id/";
2024-07-29 15:39:54 +03:00
bootDevices = [ "scsi-0QEMU_QEMU_HARDDISK_36151096" ];
2023-08-26 07:18:27 +03:00
immutable = false;
2024-07-29 15:39:54 +03:00
availableKernelModules = [
"xhci_pci"
"virtio_pci"
"virtio_scsi"
"usbhid"
"sr_mod"
"virtio_gpu"
];
2023-08-26 07:18:27 +03:00
removableEfi = true;
2024-07-29 15:39:54 +03:00
kernelParams = [ "console=tty" ];
2023-08-26 07:18:27 +03:00
sshUnlock = {
enable = true;
2024-07-29 15:39:54 +03:00
authorizedKeys = (builtins.attrValues myData.people_pubkeys) ++ [
myData.hosts."vno1-oh2.servers.jakst".publicKey
];
2023-08-26 07:18:27 +03:00
};
};
};
mj = {
stateVersion = "23.05";
timeZone = "UTC";
username = "motiejus";
2023-08-26 07:18:27 +03:00
base = {
2024-02-04 16:18:47 +02:00
users = {
enable = true;
root.hashedPasswordFile = config.age.secrets.root-passwd-hash.path;
user.hashedPasswordFile = config.age.secrets.motiejus-passwd-hash.path;
2023-08-26 07:18:27 +03:00
};
2024-01-25 14:48:17 +02:00
2023-08-26 07:18:27 +03:00
unitstatus = {
enable = true;
email = "motiejus+alerts@jakstys.lt";
};
2024-01-25 14:48:17 +02:00
snapshot = {
enable = true;
2024-07-29 15:39:54 +03:00
mountpoints = [ "/var/lib" ];
2024-01-25 14:48:17 +02:00
};
2023-08-26 07:18:27 +03:00
};
services = {
node_exporter.enable = true;
2023-09-14 06:41:16 +03:00
sshguard.enable = true;
tailscale.enable = true;
2023-08-26 07:18:27 +03:00
2024-02-27 22:56:09 +02:00
remote-builder.server = {
2024-02-25 20:04:21 +02:00
enable = true;
uidgid = myData.uidgid.remote-builder;
sshAllowSubnet = myData.subnets.tailscale.sshPattern;
publicKeys = map (h: myData.hosts.${h}.publicKey) [
"vno1-oh2.servers.jakst"
"fwminex.motiejus.jakst"
2024-06-07 23:45:30 +03:00
"mtworx.motiejus.jakst"
2024-02-25 20:04:21 +02:00
];
};
2023-08-26 07:18:27 +03:00
postfix = {
enable = true;
saslPasswdPath = config.age.secrets.sasl-passwd.path;
};
deployerbot = {
follower = {
2024-07-28 22:25:58 +03:00
publicKeys = [
myData.hosts."vno1-oh2.servers.jakst".publicKey
myData.hosts."fwminex.motiejus.jakst".publicKey
];
2023-10-01 23:14:05 +03:00
2023-08-26 07:18:27 +03:00
enable = true;
2024-07-29 15:39:54 +03:00
sshAllowSubnets = [ myData.subnets.tailscale.sshPattern ];
2023-08-26 07:18:27 +03:00
uidgid = myData.uidgid.updaterbot-deployee;
};
};
2023-08-26 23:45:03 +03:00
zfsunlock = {
2023-09-12 12:25:30 +03:00
enable = false;
2024-07-29 15:39:54 +03:00
targets."vno1-oh2.servers.jakst" =
let
host = myData.hosts."vno1-oh2.servers.jakst";
in
{
sshEndpoint = host.publicIP;
pingEndpoint = host.jakstIP;
remotePubkey = host.initrdPubKey;
pwFile = config.age.secrets.zfs-passphrase-vno1-oh2.path;
startAt = "*-*-* *:00/5:00";
};
2023-08-26 23:45:03 +03:00
};
2023-08-26 07:18:27 +03:00
};
};
2024-01-17 13:17:19 +02:00
services = {
nsd = {
enable = true;
2024-07-29 15:39:54 +03:00
interfaces = [
"0.0.0.0"
"::"
];
2024-01-17 13:17:19 +02:00
zones = {
"jakstys.lt.".data = myData.jakstysLTZone;
"11sync.net.".data = myData.e11syncZone;
};
2023-08-26 23:45:03 +03:00
};
};
2023-08-26 07:18:27 +03:00
networking = {
hostId = "bed6fa0b";
hostName = "fra1-a";
domain = "servers.jakst";
useDHCP = true;
firewall = {
2024-07-29 16:48:08 +03:00
allowedUDPPorts = [ 53 ];
2024-07-29 15:39:54 +03:00
allowedTCPPorts = [
22
53
];
2023-08-26 07:18:27 +03:00
};
};
nixpkgs.hostPlatform = "aarch64-linux";
}