From bd44fc6fcb1fe3df7b8a8c81839e34470fed7911 Mon Sep 17 00:00:00 2001 From: Grisha Shipunov Date: Sun, 12 Jan 2025 21:32:36 +0100 Subject: authentik: init --- hosts/minime/hardware-configuration.nix | 6 ++++++ hosts/minime/networking/default.nix | 3 ++- hosts/minime/networking/uvm.nix | 32 +++++++++++++++++++++++++++++--- hosts/minime/uvm.nix | 10 ++++++++++ 4 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 hosts/minime/uvm.nix (limited to 'hosts/minime') diff --git a/hosts/minime/hardware-configuration.nix b/hosts/minime/hardware-configuration.nix index 7e17821..ae2a528 100644 --- a/hosts/minime/hardware-configuration.nix +++ b/hosts/minime/hardware-configuration.nix @@ -65,6 +65,12 @@ options = [ "zfsutil" ]; }; + fileSystems."/var/lib/microvms" = { + device = "zpool/data/var/lib/microvms"; + fsType = "zfs"; + options = [ "zfsutil" ]; + }; + swapDevices = [ { device = "/dev/disk/by-partuuid/7e7d0e0b-90b7-465c-a022-089b38e0f16d"; diff --git a/hosts/minime/networking/default.nix b/hosts/minime/networking/default.nix index b1c044f..25e20b3 100644 --- a/hosts/minime/networking/default.nix +++ b/hosts/minime/networking/default.nix @@ -1,4 +1,5 @@ -{ ... }: { +{ ... }: +{ imports = [ ./uplink.nix ./uvm.nix diff --git a/hosts/minime/networking/uvm.nix b/hosts/minime/networking/uvm.nix index 15e498e..dfcb14c 100644 --- a/hosts/minime/networking/uvm.nix +++ b/hosts/minime/networking/uvm.nix @@ -1,8 +1,10 @@ -{ ... }: { +{ ... }: +{ + # TODO: make a module systemd.network = { netdevs."10-uvm-br" = { netdevConfig = { - Kind = bridge; + Kind = "bridge"; Name = "uvm-br"; }; }; @@ -13,7 +15,31 @@ DHCPServer = false; IPv6SendRA = true; }; - Address = [ ]; + addresses = [ + { + Address = "10.99.99.1/24"; + } + { + Address = "fd12:3456:789a::1/64"; + } + ]; + ipv6Prefixes = [ + { + Prefix = "fd12:3456:789a::/64"; + } + ]; }; + + networks."11-uvm-br" = { + matchConfig.Name = "uvm-*"; + networkConfig.Bridge = "uvm-br"; + }; + + }; + networking.nat = { + enable = true; + enableIPv6 = true; + externalInterface = "enp90s0"; + internalInterfaces = [ "uvm-br" ]; }; } diff --git a/hosts/minime/uvm.nix b/hosts/minime/uvm.nix new file mode 100644 index 0000000..7f10579 --- /dev/null +++ b/hosts/minime/uvm.nix @@ -0,0 +1,10 @@ +{ inputs, ... }: +{ + microvm.stateDir = "/var/lib/microvms"; + microvm.vms = { + authentik = { + flake = inputs.self; + updateFlake = "github:gshipunov/nix-config/master"; + }; + }; +} -- cgit v1.3.1