nixos-configs/common/services/tulpanomicon/default.nix

28 lines
688 B
Nix
Raw Permalink Normal View History

{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.within.services.tulpanomicon;
book = with pkgs;
callPackage (fetchgit (builtins.fromJSON (builtins.readFile ./source.json)))
{ };
in {
options.within.services.tulpanomicon.enable =
mkEnableOption "Activates tulpa --force";
config = mkIf cfg.enable {
services.nginx.virtualHosts."tulpanomicon" = {
serverName = "tulpanomicon.guide";
locations."/".root = "${book}";
forceSSL = true;
useACMEHost = "tulpanomicon.guide";
extraConfig = ''
access_log /var/log/nginx/tulpanomicon.access.log;
'';
};
services.cfdyndns.records = [ "tulpanomicon.guide" ];
};
}