diff options
| author | Alejandro Soto <alejandro@34project.org> | 2026-04-16 15:47:36 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2026-04-16 16:00:17 -0600 |
| commit | 9ad38ed82cb99ead1707105f19d87ac9122d0db3 (patch) | |
| tree | f0b3a4addd51f7202ff6e4f17e78db539234cbcf /sys/web/sites/cgit.nix | |
| parent | 48e40ad4cff334d3187a7ee90bfbfcc44213fee8 (diff) | |
Diffstat (limited to '')
| -rw-r--r-- | sys/web/sites/cgit.nix | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/sys/web/sites/cgit.nix b/sys/web/sites/cgit.nix new file mode 100644 index 0000000..09b3792 --- /dev/null +++ b/sys/web/sites/cgit.nix @@ -0,0 +1,45 @@ +{ + config, + lib, + options, + pkgs, + ... +}: +with lib; let + cfg = config.local.web.sites.cgit; + inherit (config.local) domains; +in { + options.local.web.sites.cgit = { + enable = mkEnableOption "cgit site"; + + repos = mkOption { + default = {}; + type = (options.services.cgit.type.nestedTypes.elemType.getSubOptions {}).repos.type; + }; + }; + + config = mkIf cfg.enable { + local.web = { + enable = mkDefault true; + ownedCerts = ["cgit"]; + }; + + services = { + cgit.${domains.cgit.main} = { + enable = true; + + inherit (cfg) repos; + + settings = { + enable-follow-links = true; + source-filter = "${pkgs.cgit}/lib/cgit/filters/syntax-highlighting.py"; + }; + }; + + nginx.virtualHosts.${domains.cgit.main} = { + forceSSL = true; + useACMEHost = domains.cgit.main; + }; + }; + }; +} |
