server services
This commit is contained in:
27
modules/server/caddy/default.nix
Normal file
27
modules/server/caddy/default.nix
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
self,
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.server.caddy;
|
||||
in {
|
||||
options = {
|
||||
server.caddy.enable = mkEnableOption "Enables caddy";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
networking.firewall = let
|
||||
ports = [80 443];
|
||||
in {
|
||||
allowedTCPPorts = ports;
|
||||
allowedUDPPorts = ports;
|
||||
};
|
||||
|
||||
services.caddy = {
|
||||
enable = true;
|
||||
# package = self.packages.${pkgs.system}.caddy-with-plugins;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user