diff options
author | Patryk Niedzwiedzinski <patryk@niedzwiedzinski.cyou> | 2024-09-29 16:23:16 +0200 |
---|---|---|
committer | Patryk Niedzwiedzinski <patryk@niedzwiedzinski.cyou> | 2024-09-29 16:23:16 +0200 |
commit | 4f591cc9c9663c413e8eb5cd8401a34a3251e30c (patch) | |
tree | dc46f698af4d5ba288e9e6707c2bc960e913bdd8 /machines/srv1/cgit.nix | |
parent | 4fa1a6efad786affb0729603de846d2034580db2 (diff) | |
download | dots-4f591cc9c9663c413e8eb5cd8401a34a3251e30c.tar.gz dots-4f591cc9c9663c413e8eb5cd8401a34a3251e30c.zip |
Remove old machines
Diffstat (limited to 'machines/srv1/cgit.nix')
-rw-r--r-- | machines/srv1/cgit.nix | 99 |
1 files changed, 0 insertions, 99 deletions
diff --git a/machines/srv1/cgit.nix b/machines/srv1/cgit.nix deleted file mode 100644 index 5c0749c..0000000 --- a/machines/srv1/cgit.nix +++ /dev/null @@ -1,99 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; - -let - cfg = config.services.lighttpd.pn-cgit; - pathPrefix = if stringLength cfg.subdir == 0 then "" else "/" + cfg.subdir; - configFile = pkgs.writeText "cgitrc" - '' - # default paths to static assets - css=${pathPrefix}/cgit.css - logo=${pathPrefix}/cgit.png - favicon=${pathPrefix}/favicon.ico - # user configuration - ${cfg.configText} - ''; -in -{ - - options.services.lighttpd.pn-cgit = { - - enable = mkOption { - default = false; - type = types.bool; - description = '' - If true, enable cgit (fast web interface for git repositories) as a - sub-service in lighttpd. - ''; - }; - - subdir = mkOption { - default = "cgit"; - example = ""; - type = types.str; - description = '' - The subdirectory in which to serve cgit. The web application will be - accessible at http://yourserver/''${subdir} - ''; - }; - - logo = mkOption { - default = "${pkgs.cgit}/cgit/cgit.png"; - example = ""; - type = types.str; - description = '' - Logo for your cgit server - ''; - }; - - configText = mkOption { - default = ""; - example = '' - source-filter=''${pkgs.cgit}/lib/cgit/filters/syntax-highlighting.py - about-filter=''${pkgs.cgit}/lib/cgit/filters/about-formatting.sh - cache-size=1000 - scan-path=/srv/git - ''; - type = types.lines; - description = '' - Verbatim contents of the cgit runtime configuration file. Documentation - (with cgitrc example file) is available in "man cgitrc". Or online: - http://git.zx2c4.com/cgit/tree/cgitrc.5.txt - ''; - }; - - }; - - config = mkIf cfg.enable { - - # make the cgitrc manpage available - environment.systemPackages = [ pkgs.cgit ]; - - # declare module dependencies - services.lighttpd.enableModules = [ "mod_cgi" "mod_alias" "mod_setenv" ]; - - services.lighttpd.extraConfig = '' - $HTTP["url"] =~ "^/${cfg.subdir}" { - cgi.assign = ( - "cgit.cgi" => "${pkgs.cgit}/cgit/cgit.cgi" - ) - alias.url = ( - "${pathPrefix}/cgit.css" => "${pkgs.cgit}/cgit/cgit.css", - "${pathPrefix}/cgit.png" => "${cfg.logo}", - "${pathPrefix}" => "${pkgs.cgit}/cgit/cgit.cgi" - ) - setenv.add-environment = ( - "CGIT_CONFIG" => "${configFile}" - ) - } - ''; - - systemd.services.lighttpd.preStart = '' - mkdir -p /var/cache/cgit - chown lighttpd:lighttpd /var/cache/cgit - ''; - - }; - -} |