NixOS/system/services/caddy.nix

22 lines
418 B
Nix
Raw Normal View History

2024-06-13 13:52:45 +07:00
{ config, lib, ... }:
let
cfg = config.profile.services.caddy;
inherit (lib) mkIf;
2024-06-13 13:52:45 +07:00
in
{
config = mkIf cfg.enable {
services.caddy = {
enable = true;
extraConfig = ''
import /etc/caddy/sites-enabled/*
'';
};
2024-06-13 20:52:45 +07:00
sops.secrets."router" = {
sopsFile = ../../secrets/caddy_reverse_proxy.yaml;
path = "/etc/caddy/sites-enabled/router";
mode = "0444";
};
2024-06-13 13:52:45 +07:00
};
}