summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2026-04-16 15:47:36 -0600
committerAlejandro Soto <alejandro@34project.org>2026-04-16 16:00:17 -0600
commit9ad38ed82cb99ead1707105f19d87ac9122d0db3 (patch)
treef0b3a4addd51f7202ff6e4f17e78db539234cbcf
parent48e40ad4cff334d3187a7ee90bfbfcc44213fee8 (diff)
sys/web: cgit: initial commitHEADmaster
-rw-r--r--sys/web/sites/cgit.nix45
-rw-r--r--sys/web/sites/default.nix1
-rw-r--r--sys/web/sites/pxe.nix2
3 files changed, 47 insertions, 1 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;
+ };
+ };
+ };
+}
diff --git a/sys/web/sites/default.nix b/sys/web/sites/default.nix
index 85b6020..0780794 100644
--- a/sys/web/sites/default.nix
+++ b/sys/web/sites/default.nix
@@ -1,5 +1,6 @@
{
imports = [
+ ./cgit.nix
./home.nix
./host.nix
./portal.nix
diff --git a/sys/web/sites/pxe.nix b/sys/web/sites/pxe.nix
index 54f3e56..2b2abf0 100644
--- a/sys/web/sites/pxe.nix
+++ b/sys/web/sites/pxe.nix
@@ -108,7 +108,7 @@ in {
path = [config.nix.package pkgs.sshfs pkgs.squashfsTools];
script = let
- host = lib.throw "TODO: pxe host";
+ host = "a320m";
machine = machines.${host};
in ''
set -e