config/hosts/fwminex/configuration.nix

111 lines
2.5 KiB
Nix
Raw Normal View History

2024-07-16 05:40:40 +03:00
{myData, ...}: let
nvme = "/dev/disk/by-id/nvme-Samsung_SSD_970_EVO_Plus_2TB_S6P1NS0TA01331A_1";
in {
2024-04-12 22:13:34 +03:00
imports = [
2024-07-16 05:40:40 +03:00
../../modules
../../modules/profiles/btrfs
2024-04-12 22:13:34 +03:00
];
2023-11-28 22:57:58 +02:00
boot = {
2024-07-16 05:40:40 +03:00
kernelModules = ["kvm-intel"];
2023-11-28 22:57:58 +02:00
loader.systemd-boot.enable = true;
2024-07-16 05:40:40 +03:00
initrd = {
availableKernelModules = ["xhci_pci" "thunderbolt" "nvme" "usbhid" "tpm_tis"];
systemd = {
enableTpm2 = true;
emergencyAccess = true;
};
luks.devices = {
luksroot = {
device = "${nvme}-part3";
allowDiscards = true;
crypttabExtraOpts = ["tpm2-device=auto"];
};
};
2023-11-28 22:57:58 +02:00
};
};
2024-07-16 05:40:40 +03:00
security.tpm2.enable = true;
swapDevices = [
{
device = "${nvme}-part2";
randomEncryption.enable = true;
}
];
2023-11-28 22:57:58 +02:00
fileSystems = {
"/" = {
2024-07-16 05:40:40 +03:00
device = "/dev/mapper/luksroot";
fsType = "btrfs";
options = ["compress=zstd"];
2023-11-28 22:57:58 +02:00
};
"/boot" = {
2024-07-16 05:40:40 +03:00
device = "${nvme}-part1";
2023-11-28 22:57:58 +02:00
fsType = "vfat";
};
2023-09-13 12:17:43 +03:00
};
2023-09-14 12:40:16 +03:00
hardware.cpu.intel.updateMicrocode = true;
nixpkgs.hostPlatform = "x86_64-linux";
2023-09-14 15:26:16 +03:00
systemd.services.zfs-mount.enable = false;
2023-09-13 12:17:43 +03:00
mj = {
2024-07-16 05:40:40 +03:00
stateVersion = "24.05";
2023-09-13 12:17:43 +03:00
timeZone = "Europe/Vilnius";
username = "motiejus";
2023-09-13 12:17:43 +03:00
2024-07-16 05:40:40 +03:00
base.users = {
enable = true;
user.initialPassword = "live";
#root.hashedPasswordFile = config.age.secrets.root-work-passwd-hash.path;
#user.hashedPasswordFile = config.age.secrets.motiejus-work-passwd-hash.path;
2023-09-13 12:17:43 +03:00
};
services = {
sshguard.enable = false;
2023-11-15 00:29:22 +02:00
tailscale = {
enable = true;
2024-07-16 05:40:40 +03:00
verboseLogs = false;
2023-11-15 00:29:22 +02:00
};
2024-07-16 05:40:40 +03:00
#remote-builder.client = let
# host = myData.hosts."fra1-a.servers.jakst";
#in {
# enable = true;
# inherit (host) system supportedFeatures;
# hostName = host.jakstIP;
# sshKey = "/etc/ssh/ssh_host_ed25519_key";
#};
2023-09-18 19:29:27 +03:00
node_exporter = {
enable = true;
extraSubnets = [myData.subnets.vno1.cidr];
};
2023-09-13 12:17:43 +03:00
deployerbot = {
follower = {
inherit (myData.hosts."vno1-oh2.servers.jakst") publicKey;
2023-10-01 23:14:05 +03:00
2023-09-13 12:17:43 +03:00
enable = true;
uidgid = myData.uidgid.updaterbot-deployee;
sshAllowSubnets = with myData.subnets; [tailscale.sshPattern];
2023-09-13 12:17:43 +03:00
};
};
2024-07-16 05:40:40 +03:00
#postfix = {
# enable = true;
# saslPasswdPath = config.age.secrets.sasl-passwd.path;
#};
2023-09-13 12:17:43 +03:00
};
};
networking = {
2024-07-16 05:40:40 +03:00
hostId = "a6b19da0";
2023-09-13 12:17:43 +03:00
hostName = "fwminex";
domain = "motiejus.jakst";
2023-09-22 09:58:09 +03:00
firewall.rejectPackets = true;
2023-09-13 12:17:43 +03:00
};
}