summaryrefslogtreecommitdiff
path: root/sys/web/sites/cgit.nix
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sys/web/sites/cgit.nix45
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;
+ };
+ };
+ };
+}