diff options
author | Azat Bahawi <azat@bahawi.net> | 2023-02-15 22:44:13 +0300 |
---|---|---|
committer | Azat Bahawi <azat@bahawi.net> | 2023-02-15 22:44:13 +0300 |
commit | 32cc6847c481c8ffc88240d0149fe495f3b22de5 (patch) | |
tree | 103f5abd20b59250b90746ce7d7cd0b24c321848 /modules/nixos | |
parent | 2023-02-14 (diff) |
2023-02-15
Diffstat (limited to 'modules/nixos')
-rw-r--r-- | modules/nixos/default.nix | 2 | ||||
-rw-r--r-- | modules/nixos/git/default.nix (renamed from modules/nixos/git.nix) | 96 | ||||
-rw-r--r-- | modules/nixos/git/favicon.ico | bin | 0 -> 15406 bytes | |||
-rw-r--r-- | modules/nixos/git/logo.gif | bin | 0 -> 138553 bytes |
4 files changed, 89 insertions, 9 deletions
diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index b35e461..188a999 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -14,7 +14,7 @@ _: { ./fail2ban.nix ./fonts.nix ./games - ./git.nix + ./git ./gnupg.nix ./gotify.nix ./grafana.nix diff --git a/modules/nixos/git.nix b/modules/nixos/git/default.nix index f754588..587f3b3 100644 --- a/modules/nixos/git.nix +++ b/modules/nixos/git/default.nix @@ -54,8 +54,13 @@ in { locations = { "/".extraConfig = let cgitrc = pkgs.writeText "cgitrc" '' - root-title=azahi’s git stuff - root-desc=鯛も一人はうまからず + root-title=github sux >:^( + root-desc=Homo sum, humani a me nihil alienum puto. + footer= + + logo=/cgit-custom-logo.gif + favicon=/cgit-custom-favicon.gif + css=/cgit-custom-style.css about-filter=${cfg.server.package}/lib/cgit/filters/about-formatting.sh source-filter=${cfg.server.package}/lib/cgit/filters/syntax-highlighting.py @@ -63,10 +68,9 @@ in { enable-git-config=1 enable-gitweb-owner=1 + enable-index-owner=0 remove-suffix=1 - snapshots=tar.gz tar.bz2 zip - readme=:README readme=:README.md readme=:README.org @@ -88,9 +92,80 @@ in { fastcgi_param QUERY_STRING $args; fastcgi_param HTTP_HOST $server_name; ''; - # FIXME This breaks sources previewing for these files. - "~* ^/(.+.(ico|css|png))$".extraConfig = '' - alias ${cfg.server.package}/cgit/$1; + "~* ^.+(cgit.css|robots.txt)$".extraConfig = '' + root ${cfg.server.package}/cgit; + ''; + "~* ^.+cgit-custom-logo.gif$".extraConfig = '' + alias ${./logo.gif}; + ''; + "~* ^.+cgit-custom-favicon.gif$".extraConfig = '' + alias ${./favicon.ico}; + ''; + "~* ^.+cgit-custom-style.css$".extraConfig = let + css = with config.colourScheme; + pkgs.writeText "custom.css" '' + @import url("cgit.css"); + + form { + display: none; + } + + div#cgit { + max-width: 200ch; + margin: auto; + font-family: "${config.fontScheme.monospaceFont.family}", monospace; + -moz-tab-size: 4; + tab-size: 4; + } + + div#cgit table#header td.sub { + border-top: none; + } + + div#cgit table#header td.sub.right { + padding-right: 1em; + } + + div#cgit table.tabs { + border-bottom: none; + } + + div#cgit div.content { + border-bottom: none; + } + + div#cgit table.list th a { + color: inherit; + } + + div#cgit table.list tr:nth-child(even) { + background: inherit; + } + + div#cgit table.list tr:hover { + background: inherit; + } + + div#cgit table.list tr.nohover-highlight:hover:nth-child(even) { + background: inherit; + } + + div#cgit table.blob td.linenumbers a:target { + color: goldenrod; + text-decoration: underline; + outline: none; + } + + div#cgit div#summary { + max-width: 80ch; + } + + div#cgit a.permalink { + color: inherit; + } + ''; + in '' + alias ${css}; ''; }; }; @@ -101,10 +176,15 @@ in { group = "git"; in { gitolite = { - # TODO Make the configuration purely declarative. enable = true; inherit user group; adminPubkey = my.ssh.key; + extraGitoliteRc = '' + # This allows hiding repositories via "cgit.ignore"[1]. + # + # [1]: https://www.omarpolo.com/post/cgit-gitolite.html + $RC{GIT_CONFIG_KEYS} = '.*'; + ''; }; fcgiwrap = { diff --git a/modules/nixos/git/favicon.ico b/modules/nixos/git/favicon.ico new file mode 100644 index 0000000..bb7cc39 --- /dev/null +++ b/modules/nixos/git/favicon.ico Binary files differdiff --git a/modules/nixos/git/logo.gif b/modules/nixos/git/logo.gif new file mode 100644 index 0000000..05874f9 --- /dev/null +++ b/modules/nixos/git/logo.gif Binary files differ |