26 lines
450 B
Nix
26 lines
450 B
Nix
{ lib, config }:
|
|
|
|
with lib;
|
|
let
|
|
cfg = config.services.static-website.config;
|
|
l = builtins.split cfg.name "/";
|
|
name = lists.last l;
|
|
in
|
|
{
|
|
services.static-website.config = lib.mkOption {
|
|
type = with types; attrsOf (submodule {
|
|
options.name = mkOption path;
|
|
});
|
|
};
|
|
|
|
config = {
|
|
services.nginx.enable = cfg.enable;
|
|
virtualHosts."${cfg.name}" = {
|
|
root = "/var/lib/nginx/static/${name}";
|
|
}
|
|
};
|
|
}
|
|
|
|
/* TODO
|
|
ACME
|
|
*/
|