diff options
| author | Grisha Shipunov | 2025-01-12 21:32:36 +0100 |
|---|---|---|
| committer | Grisha Shipunov | 2025-01-12 21:32:36 +0100 |
| commit | bd44fc6fcb1fe3df7b8a8c81839e34470fed7911 (patch) | |
| tree | f1a6118da93cac4f533bb001ccbb43ff18366ef3 /microvms/authentik/default.nix | |
| parent | ea46b0bb1edd0c76f9c6cf9dfcc905396e9f66b1 (diff) | |
authentik: init
Diffstat (limited to 'microvms/authentik/default.nix')
| -rw-r--r-- | microvms/authentik/default.nix | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/microvms/authentik/default.nix b/microvms/authentik/default.nix index e69de29..a0b3ac8 100644 --- a/microvms/authentik/default.nix +++ b/microvms/authentik/default.nix @@ -0,0 +1,76 @@ +{ config, lib, ... }: +let + mac = "c0:ff:ee:00:00:00"; +in +{ + imports = [ + ./authentik.nix + ]; + + sops.defaultSopsFile = ../../secrets/authentik/secrets.yaml; + sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; + + sops.secrets = { + "wg/0xa-proxy" = { + owner = config.users.users.systemd-network.name; + }; + "authentik/envfile" = { }; + }; + + microvm = { + hypervisor = "cloud-hypervisor"; + mem = 2 * 1024; + vcpu = 2; + interfaces = [ + { + type = "tap"; + id = "uvm-authentik"; + 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; + networkConfig.Address = "10.99.99.10/24"; + routes = [ + { + Gateway = "10.99.99.1"; + Destination = "0.0.0.0/0"; + Metric = 1024; + } + ]; + }; + }; + + networking.hostName = "authentik"; + system.stateVersion = "24.11"; +} |
