diff options
| author | Grisha Shipunov | 2025-02-05 18:11:49 +0000 |
|---|---|---|
| committer | Grisha Shipunov | 2025-02-06 00:41:52 +0000 |
| commit | 877e806b3a3a6ea70277087ce7f660a4e9feaf83 (patch) | |
| tree | 71cede76ab9b3670f7e16287ddd6467604c4938b /hosts/conduwuit/default.nix | |
| parent | c1352fdd88f1f3932f117fbf765b63c142376867 (diff) | |
add conduwuit matrix server
Diffstat (limited to 'hosts/conduwuit/default.nix')
| -rw-r--r-- | hosts/conduwuit/default.nix | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/hosts/conduwuit/default.nix b/hosts/conduwuit/default.nix new file mode 100644 index 0000000..59beed8 --- /dev/null +++ b/hosts/conduwuit/default.nix @@ -0,0 +1,77 @@ +{ config, lib, ... }: +let + mac = "02:00:00:00:00:06"; +in +{ + imports = [ + ./conduwuit.nix + ]; + sops.defaultSopsFile = ./secrets.yaml; + sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; + + sops.secrets = { + "wg/0xa-proxy" = { + owner = config.users.users.systemd-network.name; + }; + }; + + microvm = { + hypervisor = "qemu"; + mem = 3 * 1024; + vcpu = 2; + interfaces = [ + { + type = "tap"; + id = "uvm-conduwuit"; + 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.16/24"; + DHCP = "no"; + }; + routes = [ + { + Gateway = "10.99.99.1"; + Destination = "0.0.0.0/0"; + Metric = 1024; + } + ]; + }; + }; + + networking.hostName = "conduwuit"; + system.stateVersion = "24.11"; +} |
