Files
nix/modules/server/caddy.nix
Gustavo "Guz" L. de Mello 5ce99497d7 refactor!: I went too close into the sun
Simlified everything, things were getting out of control
2024-04-08 16:37:29 -03:00

37 lines
653 B
Nix

{
config,
lib,
...
}: let
cfg = config.server.caddy;
in {
imports = [];
options.server.caddy = with lib;
with lib.types; {
enable = mkEnableOption "";
settings = {
virtualHosts = mkOption {
type = attrsOf (submodule ({
config,
lib,
...
}: {
options = {
extraConfig = mkOption {
type = lines;
default = "";
};
};
}));
default = {};
};
};
};
config = lib.mkIf cfg.enable {
services.caddy = {
enable = true;
virtualHosts = cfg.settings.virtualHosts;
};
};
}