reading
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
{
|
||||
imports = [ ./static-nginx.nix ];
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.services.iana-angl;
|
||||
in
|
||||
{
|
||||
options.services.iana-angl = {
|
||||
enable = lib.mkEnableOption "iana-angl static site";
|
||||
|
||||
package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
description = "Static iana-angl site package to serve.";
|
||||
};
|
||||
|
||||
domain = lib.mkOption {
|
||||
type = lib.types.strMatching ".+";
|
||||
description = "Nonempty nginx virtual host domain for iana-angl.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
virtualHosts.${cfg.domain}.locations."/".extraConfig = ''
|
||||
alias ${cfg.package}/;
|
||||
try_files $uri $uri/ /index.html;
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user