nixfiles/hosts/hetzner-arm/containers/piped-fi/default.nix

70 lines
1.4 KiB
Nix
Raw Normal View History

2023-09-19 17:53:44 +01:00
{
self,
hostPath,
tree,
inputs,
config,
pkgs,
lib,
2023-09-19 17:53:44 +01:00
...
}: let
inherit (lib.modules) mkForce;
pipedName = "piped-fi";
containerName = pipedName;
2023-09-19 17:53:44 +01:00
pipedSocketForComponent = (
component: "/var/lib/nixos-containers/${containerName}/var/sockets/piped-${component}.sock"
);
in {
containers.${containerName} = {
2023-09-19 17:53:44 +01:00
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
2023-09-19 17:53:44 +01:00
];
networking.firewall.enable = mkForce false;
2023-09-19 17:53:44 +01:00
home-manager.users.root.home.stateVersion = "23.05";
system.stateVersion = "23.05";
};
};
services.nginx.virtualHosts."${pipedName}.owo.monster" = {
2023-09-19 17:53:44 +01:00
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://unix:${pipedSocketForComponent "frontend"}";
};
};
services.nginx.virtualHosts."backend.${pipedName}.owo.monster" = {
2023-09-19 17:53:44 +01:00
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://unix:${pipedSocketForComponent "backend"}";
};
};
services.nginx.virtualHosts."proxy.${pipedName}.owo.monster" = {
2023-09-19 17:53:44 +01:00
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://unix:${pipedSocketForComponent "proxy"}";
};
};
}