2025-01-12 21:32:36 +01:00
|
|
|
{ config, lib, ... }:
|
|
|
|
let
|
2025-01-12 21:42:36 +00:00
|
|
|
mac = "02:00:00:00:00:01";
|
2025-01-12 21:32:36 +01:00
|
|
|
in
|
|
|
|
{
|
|
|
|
imports = [
|
2025-01-21 00:14:24 +00:00
|
|
|
./authentik.nix
|
2025-01-12 21:32:36 +01:00
|
|
|
];
|
2025-01-19 20:46:38 +01:00
|
|
|
sops.defaultSopsFile = ./secrets.yaml;
|
2025-01-12 21:32:36 +01:00
|
|
|
sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
|
|
|
|
|
|
|
sops.secrets = {
|
|
|
|
"wg/0xa-proxy" = {
|
|
|
|
owner = config.users.users.systemd-network.name;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
microvm = {
|
2025-01-12 21:42:36 +00:00
|
|
|
hypervisor = "qemu";
|
2025-01-12 21:32:36 +01:00
|
|
|
mem = 2 * 1024;
|
|
|
|
vcpu = 2;
|
|
|
|
interfaces = [
|
|
|
|
{
|
|
|
|
type = "tap";
|
2025-01-14 21:24:05 +00:00
|
|
|
id = "uvm-auth";
|
2025-01-12 21:32:36 +01:00
|
|
|
mac = mac;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
shares =
|
|
|
|
[
|
|
|
|
{
|
|
|
|
source = "/nix/store";
|
|
|
|
mountPoint = "/nix/.ro-store";
|
|
|
|
tag = "store";
|
|
|
|
proto = "virtiofs";
|
|
|
|
socket = "store.socket";
|
|
|
|
}
|
|
|
|
]
|
|
|
|
++ map
|
|
|
|
(dir: {
|
|
|
|
source = dir;
|
|
|
|
mountPoint = "/${dir}";
|
|
|
|
tag = dir;
|
|
|
|
proto = "virtiofs";
|
|
|
|
socket = "${dir}.socket";
|
|
|
|
})
|
|
|
|
[
|
|
|
|
"etc"
|
|
|
|
"var"
|
|
|
|
"home"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
networking.useNetworkd = true;
|
|
|
|
networking.firewall.enable = lib.mkForce false; # firewalling done by the host
|
|
|
|
|
|
|
|
systemd.network = {
|
|
|
|
enable = true;
|
|
|
|
networks."11-host" = {
|
|
|
|
matchConfig.MACAddress = mac;
|
2025-01-12 21:42:36 +00:00
|
|
|
networkConfig = {
|
2025-01-14 21:24:05 +00:00
|
|
|
Address = "10.99.99.11/24";
|
2025-01-12 21:42:36 +00:00
|
|
|
DHCP = "no";
|
|
|
|
};
|
2025-01-12 21:32:36 +01:00
|
|
|
routes = [
|
|
|
|
{
|
|
|
|
Gateway = "10.99.99.1";
|
|
|
|
Destination = "0.0.0.0/0";
|
|
|
|
Metric = 1024;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2025-01-14 21:24:05 +00:00
|
|
|
networking.hostName = "auth";
|
2025-01-12 21:32:36 +01:00
|
|
|
system.stateVersion = "24.11";
|
|
|
|
}
|