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

79 lines
1.6 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;
2023-09-19 17:53:44 +01:00
containerName = "piped-fi";
pipedSocketForComponent = (
component: "/var/lib/nixos-containers/${containerName}/var/sockets/piped-${component}.sock"
);
in {
containers.piped-fi = {
autoStart = true;
privateNetwork = false;
specialArgs = {
inherit inputs;
inherit tree;
inherit self;
inherit hostPath;
};
config = {...}: {
nixpkgs.pkgs = pkgs;
imports = with tree; [
presets.nixos.containerBase
2023-09-19 17:53:44 +01:00
profiles.nginx
profiles.firewallAllow.httpCommon
2023-09-19 17:53:44 +01:00
profiles.pipedCluster
2023-09-19 17:53:44 +01:00
./secrets.nix
];
2023-09-19 17:53:44 +01:00
systemd.tmpfiles.rules = [
"d /var/lib/cockroachdb-certs - root root"
];
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."piped-fi.owo.monster" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://unix:${pipedSocketForComponent "frontend"}";
};
};
services.nginx.virtualHosts."backend.piped-fi.owo.monster" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://unix:${pipedSocketForComponent "backend"}";
};
};
services.nginx.virtualHosts."proxy.piped-fi.owo.monster" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://unix:${pipedSocketForComponent "proxy"}";
};
};
}