snowfield/modules/linkal/default.nix
2022-10-12 09:52:51 +02:00

33 lines
696 B
Nix

{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.luj.linkal;
port = 8443;
in
{
options.luj.linkal = {
enable = mkEnableOption "activate linkal service";
};
config = mkIf cfg.enable {
systemd.services.linkal = {
description = "linkal";
wantedBy = [ "multi-user.target" ];
serviceConfig.Type = "simple";
serviceConfig.ExecStart = "${pkgs.linkal}/bin/linkal --calendar-file ${./calendars.json}";
};
luj.nginx.enable = true;
services.nginx.virtualHosts."calendar.ens.malka.sh" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://localhost:${toString port}/";
};
};
};
}