config/hosts/fra1-b/configuration.nix

143 lines
3.0 KiB
Nix
Raw Permalink Normal View History

2024-07-31 00:19:40 +03:00
{
config,
myData,
modulesPath,
...
}:
2024-07-30 23:06:33 +03:00
let
disk = "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_50294864";
in
{
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
age.secrets = {
2024-08-27 08:57:17 +03:00
motiejus-passwd-hash.file = ../../secrets/motiejus_passwd_hash.age;
root-passwd-hash.file = ../../secrets/root_passwd_hash.age;
sasl-passwd.file = ../../secrets/postfix_sasl_passwd.age;
ssh8022-server = {
file = ../../secrets/ssh8022.age;
owner = "spiped";
path = "/var/lib/spiped/ssh8022.key";
};
};
2024-07-30 23:06:33 +03:00
boot = {
loader.systemd-boot.enable = true;
initrd = {
kernelModules = [ "usb_storage" ];
availableKernelModules = [
"xhci_pci"
"virtio_scsi"
"sr_mod"
];
};
};
2024-07-31 00:04:07 +03:00
fileSystems = {
"/boot" = {
device = "${disk}-part1";
fsType = "vfat";
options = [
"fmask=0022"
"dmask=0022"
];
};
"/" = {
device = "${disk}-part3";
fsType = "btrfs";
options = [
"compress=zstd"
"noatime"
];
};
2024-07-30 23:06:33 +03:00
};
swapDevices = [ { device = "${disk}-part2"; } ];
mj = {
stateVersion = "24.05";
timeZone = "UTC";
username = "motiejus";
base = {
users = {
enable = true;
2024-07-31 00:18:48 +03:00
root.hashedPasswordFile = config.age.secrets.root-passwd-hash.path;
user.hashedPasswordFile = config.age.secrets.motiejus-passwd-hash.path;
2024-07-30 23:06:33 +03:00
};
unitstatus = {
enable = true;
email = "motiejus+alerts@jakstys.lt";
};
};
services = {
node_exporter.enable = true;
ping_exporter.enable = true;
2024-07-30 23:06:33 +03:00
tailscale.enable = true;
ssh8022.server = {
enable = true;
keyfile = config.age.secrets.ssh8022-server.path;
openGlobalFirewall = false;
};
2024-07-30 23:06:33 +03:00
remote-builder.server = {
enable = true;
uidgid = myData.uidgid.remote-builder;
sshAllowSubnet = myData.subnets.tailscale.sshPattern;
publicKeys = map (h: myData.hosts.${h}.publicKey) [
2024-08-05 19:02:27 +03:00
"vno1-gdrx.motiejus.jakst"
2024-07-31 09:19:13 +03:00
"fwminex.servers.jakst"
2024-07-30 23:06:33 +03:00
"mtworx.motiejus.jakst"
];
};
2024-07-31 00:24:37 +03:00
postfix = {
enable = true;
saslPasswdPath = config.age.secrets.sasl-passwd.path;
};
2024-07-30 23:06:33 +03:00
deployerbot = {
follower = {
2024-07-31 09:19:13 +03:00
publicKeys = [ myData.hosts."fwminex.servers.jakst".publicKey ];
2024-07-30 23:06:33 +03:00
enable = true;
sshAllowSubnets = [ myData.subnets.tailscale.sshPattern ];
uidgid = myData.uidgid.updaterbot-deployee;
};
};
};
};
services = {
nsd = {
enable = true;
interfaces = [
"0.0.0.0"
"::"
];
zones = {
"jakstys.lt.".data = myData.jakstysLTZone;
"11sync.net.".data = myData.e11syncZone;
};
};
};
networking = {
hostName = "fra1-b";
domain = "servers.jakst";
useDHCP = true;
firewall = {
allowedUDPPorts = [ 53 ];
2024-08-27 08:36:02 +03:00
allowedTCPPorts = [ 53 ];
2024-07-30 23:06:33 +03:00
};
};
nixpkgs.hostPlatform = "aarch64-linux";
}