config/hosts/mtworx/configuration.nix

138 lines
3.1 KiB
Nix
Raw Normal View History

2024-03-12 21:26:31 +02:00
{
2024-03-18 17:46:17 +02:00
config,
2024-03-12 21:26:31 +02:00
myData,
...
}: let
2024-03-12 13:44:40 +02:00
nvme = "/dev/disk/by-id/nvme-WD_PC_SN810_SDCQNRY-1T00-1201_23234W800017";
2024-03-12 21:26:31 +02:00
in {
imports = [
2024-03-13 10:01:09 +02:00
../../shared/work
2024-03-12 21:26:31 +02:00
../../modules
../../modules/profiles/desktop
2024-04-12 16:37:06 +03:00
../../modules/profiles/autorandr
2024-05-06 05:55:27 +03:00
../../modules/profiles/btrfs
2024-03-12 21:26:31 +02:00
];
boot = {
kernelModules = ["kvm-intel"];
loader.systemd-boot.enable = true;
initrd = {
availableKernelModules = ["xhci_pci" "thunderbolt" "nvme" "usbhid"];
2024-07-15 20:14:58 +03:00
systemd.enableTpm2 = true;
2024-03-12 21:26:31 +02:00
luks.devices = {
luksroot = {
device = "${nvme}-part3";
allowDiscards = true;
};
};
};
};
swapDevices = [
{
device = "${nvme}-part2";
randomEncryption.enable = true;
}
];
fileSystems = {
"/" = {
device = "/dev/mapper/luksroot";
2024-03-13 15:28:35 +02:00
fsType = "btrfs";
2024-03-13 16:23:01 +02:00
options = ["compress=zstd"];
2024-03-12 21:26:31 +02:00
};
"/boot" = {
device = "${nvme}-part1";
2024-03-12 21:36:08 +02:00
fsType = "vfat";
2024-03-12 21:26:31 +02:00
};
};
hardware.cpu.intel.updateMicrocode = true;
nixpkgs.hostPlatform = "x86_64-linux";
systemd.services.zfs-mount.enable = false;
2024-03-12 21:26:31 +02:00
mj = {
stateVersion = "23.11";
timeZone = "Europe/Vilnius";
2024-03-12 21:26:31 +02:00
username = "motiejus";
base.users = {
enable = true;
2024-03-12 16:03:50 +02:00
devTools = true;
2024-03-18 17:46:17 +02:00
root.hashedPasswordFile = config.age.secrets.root-work-passwd-hash.path;
user.hashedPasswordFile = config.age.secrets.motiejus-work-passwd-hash.path;
2024-03-12 21:26:31 +02:00
};
services = {
sshguard.enable = false;
tailscale = {
enable = true;
verboseLogs = true;
};
2024-06-06 02:06:46 +03:00
wifibackup = {
enable = true;
2024-06-06 02:22:30 +03:00
toPath = "/home/${config.mj.username}/M-Active/.wifi";
2024-06-06 02:06:46 +03:00
toUser = config.mj.username;
};
2024-06-07 23:45:30 +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";
};
2024-03-12 21:26:31 +02:00
node_exporter = {
enable = true;
extraSubnets = [myData.subnets.vno1.cidr];
};
deployerbot = {
follower = {
inherit (myData.hosts."vno1-oh2.servers.jakst") publicKey;
enable = true;
uidgid = myData.uidgid.updaterbot-deployee;
sshAllowSubnets = with myData.subnets; [tailscale.sshPattern];
};
};
#postfix = {
# enable = true;
# saslPasswdPath = config.age.secrets.sasl-passwd.path;
#};
syncthing = {
enable = true;
dataDir = "/home/motiejus/";
user = "motiejus";
group = "users";
};
#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";
#};
};
};
users.extraGroups.vboxusers.members = ["motiejus"];
2024-07-15 20:59:26 +03:00
security.tpm2.enable = true;
2024-03-12 21:26:31 +02:00
networking = {
hostId = "b14a02aa";
hostName = "mtworx";
domain = "motiejus.jakst";
firewall.rejectPackets = true;
};
}