mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-10 06:22:56 +00:00
27 lines
431 B
Nix
27 lines
431 B
Nix
{ config, pkgs, lib, ... }:
|
|
|
|
let
|
|
|
|
in {
|
|
|
|
options = {
|
|
caddyServers = lib.mkOption {
|
|
type = lib.types.attrs;
|
|
description = "Caddy JSON configs for http servers";
|
|
};
|
|
};
|
|
|
|
config = {
|
|
|
|
services.caddy = {
|
|
enable = true;
|
|
adapter = "''"; # Required to enable JSON
|
|
configFile = pkgs.writeText "Caddyfile"
|
|
(builtins.toJSON { apps.http.servers = config.caddyServers; });
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|