nixos/caddy.nix
agent e7bf1acd93 Use the panel from its own flake (reudy-net/panel)
The panel's code moved to git.reudy.net/reudy-net/panel, which provides a
package and a NixOS module. This config now pulls it in as the `panel`
flake input and only sets services.reudy-panel options, so panel updates
are `nix flake update panel` instead of edits in this repo.

The input uses ssh because the reudy-net org is not visible anonymously.
The generated service, directories, Caddy vhost, routes import and reload
units are unchanged apart from store paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UbWSNkXxZhYf7eqHTyx3Bf
2026-09-27 17:56:01 +00:00

42 lines
1.3 KiB
Nix
Executable file

{ config, pkgs, ... }:
{
services.caddy = {
enable = true;
email = "admin@reudy.net";
# App routes generated by the panel are imported by its module (panel.nix).
# Authelia's own login portal
virtualHosts."auth.reudy.net".extraConfig = ''
reverse_proxy 127.0.0.1:9091
'';
# Every protected site uses this snippet
virtualHosts."hello.reudy.net".extraConfig = ''
forward_auth 127.0.0.1:9091 {
uri /api/authz/forward-auth
copy_headers Remote-User Remote-Groups Remote-Email Remote-Name
}
reverse_proxy 192.168.100.11:80
'';
# Nextcloud — served by local nginx
# (Authelia forward-auth disabled for now; re-enable by uncommenting the
# forward_auth block below.)
virtualHosts."nextcloud.reudy.net".extraConfig = ''
# forward_auth 127.0.0.1:9091 {
# uri /api/authz/forward-auth
# copy_headers Remote-User Remote-Groups Remote-Email Remote-Name
# }
reverse_proxy 127.0.0.1:8081
'';
# Forgejo — no Authelia forward-auth, since it would break git over HTTPS
# and the API. Forgejo handles its own logins.
virtualHosts."git.reudy.net".extraConfig = ''
reverse_proxy 127.0.0.1:14921
'';
};
}