config/hosts/mtworx/configuration.nix

206 lines
4.5 KiB
Nix
Raw Normal View History

2024-08-12 19:02:31 +00:00
{
config,
pkgs,
myData,
...
}:
2024-07-29 12:39:54 +00:00
let
2024-03-12 11:44:40 +00:00
nvme = "/dev/disk/by-id/nvme-WD_PC_SN810_SDCQNRY-1T00-1201_23234W800017";
2024-07-29 12:39:54 +00:00
in
{
2024-03-12 19:26:31 +00:00
imports = [
2024-03-13 08:01:09 +00:00
../../shared/work
2024-03-12 19:26:31 +00:00
../../modules
../../modules/profiles/desktop
2024-04-12 13:37:06 +00:00
../../modules/profiles/autorandr
2024-05-06 02:55:27 +00:00
../../modules/profiles/btrfs
2024-03-12 19:26:31 +00:00
];
age.secrets = {
2024-08-27 05:57:17 +00:00
motiejus-work-passwd-hash.file = ../../secrets/motiejus_work_passwd_hash.age;
root-work-passwd-hash.file = ../../secrets/root_work_passwd_hash.age;
sasl-passwd.file = ../../secrets/postfix_sasl_passwd.age;
2024-08-27 05:57:17 +00:00
syncthing-key.file = ../../secrets/mtworx/syncthing/key.pem.age;
syncthing-cert.file = ../../secrets/mtworx/syncthing/cert.pem.age;
2024-12-02 23:18:40 +00:00
kolide-launcher.file = ../../secrets/mtworx/kolide-launcher.age;
ssh8022-client = {
file = ../../secrets/ssh8022.age;
mode = "444";
};
2024-08-25 08:07:35 +00:00
};
2024-03-12 19:26:31 +00:00
boot = {
2024-11-19 20:42:56 +00:00
kernelPackages = pkgs.linuxPackages_6_11;
2024-03-12 19:26:31 +00:00
initrd = {
2024-07-29 12:39:54 +00:00
availableKernelModules = [
"xhci_pci"
"thunderbolt"
"nvme"
"usbhid"
"tpm_tis"
];
systemd.emergencyAccess = true;
2024-03-12 19:26:31 +00:00
luks.devices = {
luksroot = {
device = "${nvme}-part3";
allowDiscards = true;
2024-07-29 12:39:54 +00:00
crypttabExtraOpts = [ "tpm2-device=auto" ];
2024-03-12 19:26:31 +00:00
};
};
};
};
swapDevices = [
{
device = "${nvme}-part2";
randomEncryption.enable = true;
}
];
fileSystems = {
"/" = {
device = "/dev/mapper/luksroot";
2024-03-13 13:28:35 +00:00
fsType = "btrfs";
2024-07-29 12:39:54 +00:00
options = [ "compress=zstd" ];
2024-03-12 19:26:31 +00:00
};
"/boot" = {
device = "${nvme}-part1";
2024-03-12 19:36:08 +00:00
fsType = "vfat";
2024-03-12 19:26:31 +00:00
};
};
2025-02-06 18:11:58 +00:00
hardware.coral.usb.enable = true;
2024-03-12 19:26:31 +00:00
hardware.cpu.intel.updateMicrocode = true;
nixpkgs.hostPlatform = "x86_64-linux";
mj = {
stateVersion = "23.11";
2025-01-23 09:52:39 +00:00
timeZone = "UTC";
2024-03-12 19:26:31 +00:00
username = "motiejus";
base.users = {
enable = true;
2024-03-12 14:03:50 +00:00
devTools = true;
2024-03-18 15:46:17 +00:00
root.hashedPasswordFile = config.age.secrets.root-work-passwd-hash.path;
user.hashedPasswordFile = config.age.secrets.motiejus-work-passwd-hash.path;
2024-03-12 19:26:31 +00:00
};
services = {
2024-08-25 08:07:35 +00:00
ssh8022.client = {
enable = true;
keyfile = config.age.secrets.ssh8022-client.path;
};
2024-08-24 19:00:37 +00:00
2024-03-12 19:26:31 +00:00
tailscale = {
enable = true;
verboseLogs = true;
2024-11-21 05:03:21 +00:00
acceptDNS = true;
2024-03-12 19:26:31 +00:00
};
2024-07-29 13:11:01 +00:00
btrfssnapshot = {
enable = true;
2024-07-29 13:31:32 +00:00
subvolumes = [
{
subvolume = "/home";
2024-07-29 13:11:01 +00:00
label = "5minutely";
keep = 12;
refreshInterval = "*:0/5";
2024-07-29 13:31:32 +00:00
}
{
subvolume = "/home";
label = "hourly";
keep = 24;
refreshInterval = "*:00:00";
}
2024-08-12 18:21:07 +00:00
{
subvolume = "/home";
label = "daily";
keep = 7;
refreshInterval = "daily UTC";
}
2024-07-29 13:31:32 +00:00
];
2024-07-29 13:11:01 +00:00
};
2024-06-05 23:06:46 +00:00
wifibackup = {
enable = true;
2024-06-05 23:22:30 +00:00
toPath = "/home/${config.mj.username}/M-Active/.wifi";
2024-06-05 23:06:46 +00:00
toUser = config.mj.username;
};
2024-07-29 12:39:54 +00:00
remote-builder.client =
let
2025-03-08 21:47:31 +00:00
host = myData.hosts."fra1-b.jakst.vpn";
2024-07-29 12:39:54 +00:00
in
{
enable = true;
inherit (host) system supportedFeatures;
hostName = host.jakstIP;
sshKey = "/etc/ssh/ssh_host_ed25519_key";
2024-07-30 22:06:24 +00:00
maxJobs = 2;
2024-07-29 12:39:54 +00:00
};
2024-06-07 20:45:30 +00:00
2024-03-12 19:26:31 +00:00
node_exporter = {
enable = true;
2024-07-29 12:39:54 +00:00
extraSubnets = [ myData.subnets.vno1.cidr ];
2024-03-12 19:26:31 +00:00
};
deployerbot = {
follower = {
2025-03-08 21:47:31 +00:00
publicKeys = [ myData.hosts."fwminex.jakst.vpn".publicKey ];
2024-03-12 19:26:31 +00:00
enable = true;
uidgid = myData.uidgid.updaterbot-deployee;
2024-07-29 12:39:54 +00:00
sshAllowSubnets = with myData.subnets; [ tailscale.sshPattern ];
2024-03-12 19:26:31 +00:00
};
};
2024-08-05 13:41:24 +00:00
postfix = {
2024-08-05 16:04:46 +00:00
enable = false;
#saslPasswdPath = config.age.secrets.sasl-passwd.path;
2024-08-05 13:41:24 +00:00
};
2024-03-12 19:26:31 +00:00
syncthing = {
enable = true;
dataDir = "/home/motiejus/";
user = "motiejus";
group = "users";
};
};
};
2024-10-08 02:52:14 +00:00
services = {
tlp = {
enable = true;
settings = {
2024-10-30 19:41:07 +00:00
START_CHARGE_THRESH_BAT0 = 80;
STOP_CHARGE_THRESH_BAT0 = 87;
2024-10-08 02:52:14 +00:00
};
2024-10-05 17:05:37 +00:00
};
2024-12-02 23:18:40 +00:00
kolide-launcher.enable = true;
2024-10-05 17:05:37 +00:00
};
2024-07-29 12:39:54 +00:00
users.extraGroups.vboxusers.members = [ "motiejus" ];
2024-03-12 19:26:31 +00:00
2024-12-02 23:18:40 +00:00
environment = {
systemPackages = with pkgs; [ dnsmasq ];
etc."kolide-k2/secret" = {
mode = "600";
source = config.age.secrets.kolide-launcher.path;
};
};
2024-09-20 11:36:09 +00:00
2024-07-15 17:59:26 +00:00
security.tpm2.enable = true;
2024-03-12 19:26:31 +00:00
networking = {
hostId = "b14a02aa";
hostName = "mtworx";
2025-03-08 21:47:31 +00:00
domain = "jakst.vpn";
2024-03-12 19:26:31 +00:00
firewall.rejectPackets = true;
};
}