From 7ec1dae878c117efb65ed47421a29d5b20ab1c6b Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Sun, 8 Oct 2023 21:43:59 +0200 Subject: Fix syntax? --- host/Rory-nginx/services/cgit.nix | 94 ++++++++++++++++++++------------------- 1 file changed, 49 insertions(+), 45 deletions(-) diff --git a/host/Rory-nginx/services/cgit.nix b/host/Rory-nginx/services/cgit.nix index c0aa67b..000f30a 100644 --- a/host/Rory-nginx/services/cgit.nix +++ b/host/Rory-nginx/services/cgit.nix @@ -2,55 +2,59 @@ { - services.cgit."main" = { - enable = true; - nginx.virtualHost = "cgit.rory.gay"; - package = pkgs.cgit-pink; - scanPath = "/data/nginx/html_git"; - settings = { - css = "/cgit.css"; - logo = "/cgit.png"; - favicon = "/favicon.ico"; - about-filter = "${pkgs.cgit-pink}/lib/cgit/filters/about-formatting.sh"; - source-filter = "${pkgs.cgit-pink}/lib/cgit/filters/syntax-highlighting.py"; - clone-url = (lib.concatStringsSep " " [ - "https://git.rory.gay/$CGIT_REPO_URL" - "ssh://@git.rory.gay:$CGIT_REPO_URL" - ]); - enable-log-filecount = 1; - enable-log-linecount = 1; - enable-git-config = 1; -#testing - enable-blame = 1; - enable-commit-graph = 1; - enable-follow-links = 1; - enable-http-clone = 1; - enable-index-links = 1; - enable-remote-branches = 1; - enable-subject-links = 1; - enable-tree-linenumbers = 1; - max-atom-items = 100; - max-commit-count = 250; - max-repo-count = 500; - snapshots = "tar.xz"; - #side-by-side-diffs = 1; + let base_cgit_config = { + { + enable = true; + nginx.virtualHost = "cgit.rory.gay"; + package = pkgs.cgit-pink; + scanPath = "/data/nginx/html_git"; + settings = { + css = "/cgit.css"; + logo = "/cgit.png"; + favicon = "/favicon.ico"; + about-filter = "${pkgs.cgit-pink}/lib/cgit/filters/about-formatting.sh"; + source-filter = "${pkgs.cgit-pink}/lib/cgit/filters/syntax-highlighting.py"; + clone-url = (lib.concatStringsSep " " [ + "https://git.rory.gay/$CGIT_REPO_URL" + "ssh://@git.rory.gay:$CGIT_REPO_URL" + ]); + enable-log-filecount = 1; + enable-log-linecount = 1; + enable-git-config = 1; + #testing + enable-blame = 1; + enable-commit-graph = 1; + enable-follow-links = 1; + enable-http-clone = 1; + enable-index-links = 1; + enable-remote-branches = 1; + enable-subject-links = 1; + enable-tree-linenumbers = 1; + max-atom-items = 100; + max-commit-count = 250; + max-repo-count = 500; + snapshots = "tar.xz"; + #side-by-side-diffs = 1; - root-title = "cgit.rory.gay"; - root-desc = "Rory&s Git Repositories"; + root-title = "cgit.rory.gay"; + root-desc = "Rory&s Git Repositories"; + }; }; - }; + } in { + services.cgit."main" = base_cgit_config; -services.cgit."ocp" = config.services.cgit."main" // { - scanPath = "/data/nginx/html_git/.ocp"; - nginx.location = "/.ocp/"; - settings = { - clone-url = (lib.concatStringsSep " " [ - "https://git.rory.gay/.ocp/$CGIT_REPO_URL" - "ssh://@git.rory.gay:.ocp/$CGIT_REPO_URL" - ]); - }; -}; + services.cgit."ocp" = base_cgit_config // { + scanPath = "/data/nginx/html_git/.ocp"; + nginx.location = "/.ocp/"; + settings = { + clone-url = (lib.concatStringsSep " " [ + "https://git.rory.gay/.ocp/$CGIT_REPO_URL" + "ssh://@git.rory.gay:.ocp/$CGIT_REPO_URL" + ]); + }; + }; + } } -- cgit 1.4.1