nixos/roles/server/ivabus-dev.nix

26 lines
656 B
Nix
Raw Normal View History

2023-09-06 11:20:33 +03:00
{ config, lib, pkgs, ... }:
let cfg = config.my.roles.server.ivabus-dev;
in {
options.my.roles.server.ivabus-dev.enable =
lib.mkEnableOption "Serve ivabus.dev";
2023-09-06 11:20:33 +03:00
config = lib.mkIf (cfg.enable) {
my.roles.server.nginx.enable = true;
services.nginx = {
virtualHosts."ivabus.dev" = {
2023-09-07 20:19:06 +03:00
forceSSL = true;
enableACME = true;
quic = true;
http3 = true;
2023-09-07 20:19:06 +03:00
root = pkgs.callPackage ../../pkgs/ivabus-dev.nix { };
2023-09-06 11:20:33 +03:00
extraConfig = ''
error_page 404 /404.html;
add_header Access-Control-Allow-Origin *;
2023-09-06 11:20:33 +03:00
'';
serverAliases = [ "www.ivabus.dev" ];
2023-09-06 11:20:33 +03:00
};
};
};
}