{ self, hostPath, tree, inputs, config, pkgs, ... }: let pipedName = "piped-fi"; containerName = pipedName; containerAddresses = import "${hostPath}/data/containerAddresses.nix"; hostIP = containerAddresses.host; containerIP = containerAddresses.containers.${containerName}; pipedSocketForComponent = ( component: "/var/lib/nixos-containers/${containerName}/var/sockets/piped-${component}.sock" ); in { containers.${containerName} = { autoStart = true; privateNetwork = true; hostAddress = hostIP; localAddress = containerIP; specialArgs = { inherit inputs; inherit tree; inherit self; inherit hostPath; }; config = {...}: { nixpkgs.pkgs = pkgs; imports = with tree; [ presets.nixos.containerBase presets.nixos.pipedNode ]; home-manager.users.root.home.stateVersion = "23.05"; system.stateVersion = "23.05"; }; }; services.nginx.virtualHosts."${pipedName}.owo.monster" = { forceSSL = true; enableACME = true; locations."/" = { proxyPass = "http://unix:${pipedSocketForComponent "frontend"}"; }; }; services.nginx.virtualHosts."backend.${pipedName}.owo.monster" = { forceSSL = true; enableACME = true; locations."/" = { proxyPass = "http://unix:${pipedSocketForComponent "backend"}"; }; }; services.nginx.virtualHosts."proxy.${pipedName}.owo.monster" = { forceSSL = true; enableACME = true; locations."/" = { proxyPass = "http://unix:${pipedSocketForComponent "proxy"}"; }; }; }