2023-08-26 07:18:27 +03:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
myData,
|
|
|
|
modulesPath,
|
|
|
|
...
|
|
|
|
}: {
|
|
|
|
imports = [(modulesPath + "/profiles/qemu-guest.nix")];
|
|
|
|
|
|
|
|
zfs-root = {
|
|
|
|
boot = {
|
|
|
|
enable = true;
|
|
|
|
devNodes = "/dev/disk/by-id/";
|
|
|
|
bootDevices = ["scsi-0QEMU_QEMU_HARDDISK_36151096"];
|
|
|
|
immutable = false;
|
|
|
|
availableKernelModules = ["xhci_pci" "virtio_pci" "virtio_scsi" "usbhid" "sr_mod" "virtio_gpu"];
|
|
|
|
removableEfi = true;
|
|
|
|
kernelParams = ["console=tty"];
|
|
|
|
sshUnlock = {
|
|
|
|
enable = true;
|
|
|
|
authorizedKeys =
|
|
|
|
(builtins.attrValues myData.people_pubkeys)
|
|
|
|
++ [
|
|
|
|
myData.hosts."vno1-oh2.servers.jakst".publicKey
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
mj = {
|
|
|
|
stateVersion = "23.05";
|
|
|
|
timeZone = "UTC";
|
2024-03-06 10:33:48 +02:00
|
|
|
username = "motiejus";
|
|
|
|
|
2023-08-26 07:18:27 +03:00
|
|
|
base = {
|
2024-02-04 16:18:47 +02:00
|
|
|
users = {
|
|
|
|
enable = true;
|
2024-03-06 10:33:48 +02:00
|
|
|
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;
|
|
|
|
mountpoints = ["/var/lib"];
|
|
|
|
};
|
|
|
|
|
|
|
|
zfsborg = {
|
|
|
|
enable = true;
|
|
|
|
passwordPath = config.age.secrets.borgbackup-password.path;
|
|
|
|
sshKeyPath = "/etc/ssh/ssh_host_ed25519_key";
|
|
|
|
dirs = [
|
|
|
|
{
|
|
|
|
mountpoint = "/var/lib";
|
|
|
|
repo = "zh2769@zh2769.rsync.net:${config.networking.hostName}.${config.networking.domain}-var_lib";
|
|
|
|
paths = ["private/e11sync-backend"];
|
|
|
|
backup_at = "*-*-* 01:00:00 UTC";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2023-08-26 07:18:27 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
services = {
|
|
|
|
node_exporter.enable = true;
|
2023-09-14 06:41:16 +03:00
|
|
|
sshguard.enable = true;
|
2023-10-22 20:14:25 +03:00
|
|
|
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 = {
|
2023-10-01 23:26:01 +03:00
|
|
|
inherit (myData.hosts."vno1-oh2.servers.jakst") publicKey;
|
2023-10-01 23:14:05 +03:00
|
|
|
|
2023-08-26 07:18:27 +03:00
|
|
|
enable = true;
|
2023-09-18 20:49:17 +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;
|
2023-08-26 23:45:03 +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 07:18:27 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-01-17 13:17:19 +02:00
|
|
|
e11sync = {
|
2023-08-26 23:45:03 +03:00
|
|
|
enable = true;
|
2024-01-17 13:17:19 +02:00
|
|
|
migrateOnStart = true;
|
|
|
|
secretKeyPath = config.age.secrets.e11sync-secret-key.path;
|
|
|
|
vhost = "11sync.net";
|
|
|
|
};
|
|
|
|
|
|
|
|
services = {
|
|
|
|
nsd = {
|
|
|
|
enable = true;
|
|
|
|
interfaces = ["0.0.0.0" "::"];
|
|
|
|
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-01-17 13:17:19 +02:00
|
|
|
allowedUDPPorts = [53 443];
|
|
|
|
allowedTCPPorts = [22 53 80 443];
|
2023-08-26 07:18:27 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
nixpkgs.hostPlatform = "aarch64-linux";
|
|
|
|
}
|