{
  self,
  hostPath,
  tree,
  inputs,
  config,
  pkgs,
  lib,
  ...
}: let
  inherit (lib.modules) mkForce;

  pipedName = "piped-uk";
  containerName = pipedName;

  pipedSocketForComponent = (
    component: "/var/lib/nixos-containers/${containerName}/var/sockets/piped-${component}.sock"
  );
in {
  containers.${containerName} = {
    autoStart = true;
    privateNetwork = false;

    specialArgs = {
      inherit inputs;
      inherit tree;
      inherit self;
      inherit hostPath;
    };

    config = {...}: {
      nixpkgs.pkgs = pkgs;

      imports = with tree; [
        presets.nixos.containerBase
        presets.nixos.pipedNode
      ];

      networking.firewall.enable = mkForce false;

      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"}";
    };
  };
}