diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/cgit-taz/default.nix | 70 | ||||
-rw-r--r-- | web/cgit-taz/thttpd_cgi_idx.patch | 13 | ||||
-rw-r--r-- | web/tvl/default.nix | 74 | ||||
-rw-r--r-- | web/tvl/static/favicon.webp | bin | 0 -> 14710 bytes | |||
-rw-r--r-- | web/tvl/static/virus_lounge.webp | bin | 0 -> 77556 bytes | |||
-rw-r--r-- | web/tvl/tvl.dot | 187 |
6 files changed, 344 insertions, 0 deletions
diff --git a/web/cgit-taz/default.nix b/web/cgit-taz/default.nix new file mode 100644 index 000000000000..7266ae00aabe --- /dev/null +++ b/web/cgit-taz/default.nix @@ -0,0 +1,70 @@ +# This derivation configures a 'cgit' instance to serve repositories +# from a different source. + +{ depot, ... }: + +with depot.third_party; + +let + sourceFilter = writeShellScriptBin "cheddar-about" '' + exec ${depot.tools.cheddar}/bin/cheddar --about-filter $@ + ''; + cgitConfig = writeText "cgitrc" '' + # Global configuration + virtual-root=/ + enable-http-clone=1 + readme=:README.md + about-filter=${sourceFilter}/bin/cheddar-about + source-filter=${depot.tools.cheddar}/bin/cheddar + enable-log-filecount=1 + enable-log-linecount=1 + enable-follow-links=1 + enable-blame=1 + mimetype-file=${mime-types}/etc/mime.types + logo=/plain/fun/logo/depot-logo.png + + # Repository configuration + repo.url=depot + repo.path=/var/lib/gerrit/git/depot.git/ + repo.desc=monorepo for tazjin's virus lounge + repo.owner=tazjin <mail@tazj.in> + repo.clone-url=https://code.tvl.fyi + ''; + + thttpdConfig = writeText "thttpd.conf" '' + port=2448 + dir=${cgit}/cgit + nochroot + novhost + cgipat=**.cgi + ''; + + # Patched version of thttpd that serves cgit.cgi as the index and + # sets the environment variable for pointing cgit at the correct + # configuration. + # + # Things are done this way because recompilation of thttpd is much + # faster than cgit and I don't want to wait long when iterating on + # config. + thttpdConfigPatch = writeText "thttpd_cgit_conf.patch" '' + diff --git a/libhttpd.c b/libhttpd.c + index c6b1622..eef4b73 100644 + --- a/libhttpd.c + +++ b/libhttpd.c + @@ -3055,4 +3055,6 @@ make_envp( httpd_conn* hc ) + + envn = 0; + + // force cgit to load the correct configuration + + envp[envn++] = "CGIT_CONFIG=${cgitConfig}"; + envp[envn++] = build_env( "PATH=%s", CGI_PATH ); + #ifdef CGI_LD_LIBRARY_PATH + ''; + thttpdCgit = thttpd.overrideAttrs(old: { + patches = [ + ./thttpd_cgi_idx.patch + thttpdConfigPatch + ]; + }); +in writeShellScriptBin "cgit-launch" '' + exec ${thttpdCgit}/bin/thttpd -D -C ${thttpdConfig} +'' diff --git a/web/cgit-taz/thttpd_cgi_idx.patch b/web/cgit-taz/thttpd_cgi_idx.patch new file mode 100644 index 000000000000..67dbc0c7ab80 --- /dev/null +++ b/web/cgit-taz/thttpd_cgi_idx.patch @@ -0,0 +1,13 @@ +diff --git a/config.h b/config.h +index 65ab1e3..cde470f 100644 +--- a/config.h ++++ b/config.h +@@ -327,7 +327,7 @@ + /* CONFIGURE: A list of index filenames to check. The files are searched + ** for in this order. + */ +-#define INDEX_NAMES "index.html", "index.htm", "index.xhtml", "index.xht", "Default.htm", "index.cgi" ++#define INDEX_NAMES "cgit.cgi" + + /* CONFIGURE: If this is defined then thttpd will automatically generate + ** index pages for directories that don't have an explicit index file. diff --git a/web/tvl/default.nix b/web/tvl/default.nix new file mode 100644 index 000000000000..552940cb5135 --- /dev/null +++ b/web/tvl/default.nix @@ -0,0 +1,74 @@ +{ depot, pkgs, ... }: + +let + inherit (pkgs) graphviz runCommandNoCC writeText; + + tvlGraph = runCommandNoCC "tvl.svg" { + nativeBuildInputs = with pkgs; [ fontconfig freetype cairo jetbrains-mono ]; + } '' + ${graphviz}/bin/neato -Tsvg ${./tvl.dot} > $out + ''; + + homepage = writeText "index.html" '' + <!DOCTYPE html> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <meta name="description" content="tazjin's Virus Lounge"> + <link rel="stylesheet" type="text/css" href="/static/tazjin.css" media="all"> + <link rel="icon" type="image/webp" href="/static/favicon.webp"> + <title>tazjin's Virus Lounge</title> + <style> + svg { + max-width: inherit; + height: auto; + } + </style> + </head> + <body class="light"> + <header> + <h1><a class="blog-title" href="/">tazjin's Virus Lounge</a> </h1> + <hr> + </header> + + <main> + <img alt="tazjin's Virus Lounge" src="/static/virus_lounge.webp"> + </main> + + <p> + Welcome to <b>tazjin's Virus Lounge</b>. We're a random group of + people who feel undersocialised in these trying times, and + we've decided that there isn't enough spontaneous socialising + on the internet. + </p> + + <hr> + <h2>Where did all these people come from?</h2> + + <p> + It's pretty straightforward. Feel free to click on people, too. + </p> + ${builtins.readFile tvlGraph} + + <hr> + <footer> + <p class="footer"> + <a class="uncoloured-link" href="https://tazj.in">homepage</a> + | + <a class="uncoloured-link" href="https://cs.tvl.fyi/depot/-/blob/README.md">code</a> + | + <a class="uncoloured-link" href="https://twitter.com/tazjin">twitter</a> + </p> + <p class="lod">ಠ_ಠ</p> + </footer> + </body> + ''; +in runCommandNoCC "website" {} '' + mkdir -p $out/static + cp ${homepage} $out/index.html + cp -r ${./static}/* $out/static + + # Some assets are stolen from tazjin's blog + cp ${depot.users.tazjin.homepage}/static/jetbrains-* $out/static + cp ${depot.users.tazjin.homepage}/static/tazjin.css $out/static +'' diff --git a/web/tvl/static/favicon.webp b/web/tvl/static/favicon.webp new file mode 100644 index 000000000000..42fdc7b44cfb --- /dev/null +++ b/web/tvl/static/favicon.webp Binary files differdiff --git a/web/tvl/static/virus_lounge.webp b/web/tvl/static/virus_lounge.webp new file mode 100644 index 000000000000..1f898b6ad8a7 --- /dev/null +++ b/web/tvl/static/virus_lounge.webp Binary files differdiff --git a/web/tvl/tvl.dot b/web/tvl/tvl.dot new file mode 100644 index 000000000000..31ee03a71180 --- /dev/null +++ b/web/tvl/tvl.dot @@ -0,0 +1,187 @@ +digraph tvl { + node [fontname = "JetBrains Mono"]; + overlap = false; + splines = polyline; + + TVL [style="bold" href="http://tvl.fyi"]; + tazjin -> TVL [style="bold"]; + + // people + subgraph { + ac [href="https://the-alex.github.io/about/"]; + andi [label="andi-" href="https://andreas.rammhold.de/"]; + anon1 [color="grey" fontcolor="grey"]; + aranea; + artemist [href="https://artem.ist/"]; + aurora [href="https://nonegenderleftfox.aventine.se/"]; + benjojo [href="https://benjojo.co.uk/"]; + borb [href="https://twitter.com/FR31H31T"]; + cynthia [href="https://cynthia.re/"]; + edef [href="https://edef.eu/files/edef.hs"]; + ericvolp [href="https://ericv.me"]; + espes; + eta [href="https://theta.eu.org/"]; + firefly [href="http://firefly.nu/"]; + flokli [href="https://flokli.de/"]; + ghuntley [href="https://ghuntley.com/"]; + glittershark [href="http://gws.fyi"]; + grahamc [href="https://grahamc.com/"]; + hyperfekt [href="https://hyperfekt.net"]; + isomer [href="https://www.lorier.net/"]; + jooiiee [href="https://jooiiee.se/"]; + jusrin [href="https://jusrin.dev/"]; + kanepyork [href="https://social.wxcafe.net/@riking"]; + leah2 [href="https://leahneukirchen.org/"]; + lukegb [href="https://lukegb.com/"]; + marcusr [href="http://marcus.nordaaker.com/"]; + maskerad [href="https://femalelegends.com/"]; + multi [href="https://1.0.168.192.in-addr.xyz/"]; + ncl; + nyanotech [href="https://twitter.com/nyanotech"]; + poigon; + profpatsch [href="http://profpatsch.de/"]; + puck [href="https://puckipedia.com/"]; + q3k [href="https://q3k.org/"]; + qyliss [href="https://alyssa.is"]; + rcombs [href="http://rcombs.me/"]; + seven [href="https://open.spotify.com/user/so7"]; + tazjin [href="https://tazj.in/"]; + tehhobbit; + wpcarro [href="https://wpcarro.dev/"]; + } + + // companies (blue) + subgraph { + node [color="#4285f4" fontcolor="#4285f4"]; + spotify [href="https://www.spotify.com/"]; + google [href="https://www.google.com/"]; + } + + // communities? (red) + subgraph { + node [color="#db4437" fontcolor="#db4437"]; + eve [href="https://www.eveonline.com/"]; + nix [href="https://nixos.org/nix/"]; + ircv3 [href="https://ircv3.net/"]; + lgbtslack [label="lgbt.tech" href="https://lgbtq.technology/"]; + muccc [label="µccc" href="https://muc.ccc.de/"]; + hswaw [href="https://hackerspace.pl/"]; + } + + // special + subgraph { + baby [color="pink" fontcolor="pink" href="https://cynthia.re/s/baby"]; + unspecific [color="grey" fontcolor="grey"]; + } + + // primary edges (how did they end up in TVL?) + subgraph { + // Direct edges + nix -> tazjin; + spotify -> tazjin; + google -> tazjin; + eve -> tazjin; + unspecific -> tazjin; + edef -> tazjin; + + // via nix + jusrin -> nix; + ghuntley -> nix; + flokli -> nix; + andi -> nix; + grahamc -> nix; + profpatsch -> nix; + + // via edef + benjojo -> edef; + espes -> edef; + firefly -> edef; + leah2 -> aurora; + multi -> edef; + ncl -> edef; + puck -> edef; + qyliss -> edef; + rcombs -> edef; + + // via spotify + tehhobbit -> spotify; + seven -> spotify; + + // via google + lukegb -> google; + isomer -> google; + wpcarro -> google; + + // random primary + ac -> wpcarro; + anon1 -> google; + aranea -> multi; + artemist -> cynthia; + aurora -> eve; + borb -> unspecific; + cynthia -> benjojo; + eta -> anon1; + ericvolp -> lukegb; + glittershark -> wpcarro; + jooiiee -> unspecific; + kanepyork -> lukegb; + marcusr -> unspecific; + maskerad -> unspecific; + nyanotech -> kanepyork; + poigon -> eve; + q3k -> unspecific; + hyperfekt -> espes; + } + + // secondary edges (how are they connected otherwise?) + subgraph { + edge [weight=0 style="dotted" color="grey" arrowhead="none"]; + + // lgbt slack + aurora -> lgbtslack; + leah2 -> lgbtslack; + edef -> lgbtslack; + artemist -> lgbtslack; + + // ircv3 + multi -> ircv3; + eta -> ircv3; + firefly -> ircv3; + + // µccc + leah2 -> muccc; + q3k -> muccc; + + // hswaw + q3k -> hswaw; + + // random + leah2 -> edef; + lukegb -> isomer; + eta -> multi; + eta -> firefly; + cynthia -> firefly; + cynthia -> lukegb; + kanepyork -> google; + nyanotech -> google; + lukegb -> benjojo; + multi -> benjojo; + espes -> benjojo; + espes -> aurora; + puck -> nix; + qyliss -> nix; + glittershark -> nix; + edef -> nix; + aranea -> nix; + aranea -> profpatsch; + artemist -> nix; + hyperfekt -> edef; + } + + // baby + subgraph { + edge [weight=0 style="dotted" color="pink" arrowhead="none"]; + cynthia -> baby; + eta -> baby; + } +} |