From 42aa8b3a7873c38a1769cef27b7215b683f25737 Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Tue, 21 Jan 2025 17:39:25 +0000 Subject: immich: init --- hosts/immich/default.nix | 78 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 hosts/immich/default.nix (limited to 'hosts/immich/default.nix') diff --git a/hosts/immich/default.nix b/hosts/immich/default.nix new file mode 100644 index 0000000..5c3db21 --- /dev/null +++ b/hosts/immich/default.nix @@ -0,0 +1,78 @@ + +{ config, lib, ... }: +let + mac = "02:00:00:00:00:03"; +in +{ + imports = [ + ./immich.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 = 4 * 1024; + vcpu = 2; + interfaces = [ + { + type = "tap"; + id = "uvm-immich"; + 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.13/24"; + DHCP = "no"; + }; + routes = [ + { + Gateway = "10.99.99.1"; + Destination = "0.0.0.0/0"; + Metric = 1024; + } + ]; + }; + }; + + networking.hostName = "immich"; + system.stateVersion = "24.11"; +} -- cgit v1.3.1