This drops the old LDAP configuration and uses CAS instead. All hail the
hypnotoad.
Change-Id: I515a213f09073bb52bfb75afe2988b935a076087
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2783
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Add the OAuth gerrit plugin to our mini collection of Gerrit plugins.
This includes a patch to make the plugin work correctly with CAS 6.x,
which has changed the attributes into a JSON object with the attributes
nested inside, instead of a JSON list.
Change-Id: I4741f137cca9c8eb45b9ea660fb4cbf6962be9a4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2782
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
I'm dropping the leaveDotGit and deepClone bits; they were set like that
purely to try to make the build stamping work. In practice, not only
does the build stamping not work, but it also means we hit some
inconveniently-different hashes from time to time when gitiles does...
something??? on its backend.
I'm also putting some gcroots for these on whitby, which should also
help a bit, although it's a bit of a hack.
Change-Id: Ie6082248393e62795c18b1971fc2d16f4e8cc81d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2781
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Until I come up with a better idea.
Change-Id: Ie44cae4c2df264cbe1a70f5ebcca814262dd2800
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2771
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
Instead of putting the subject in quotes, we instead reorder the message
to be of the format:
CL/2768 applied by lukegb - chore(clbot): reformat messages - https://cl.tvl.fyi/2768
Change-Id: I77d19525c399396a91797f423bdfc92069d47f9f
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2768
Reviewed-by: glittershark <grfn@gws.fyi>
Tested-by: BuildkiteCI
All user configs and modules have been migrated to using the depot
module parameter. All hail the hypnotoad.
Change-Id: Ic05c61fccba3ac505a339283b6ef3105a2d0711c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2765
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Previously the tvl depot attrset was provided as the config.depot
argument, but to make NixOS modules look more like the rest of the depot
this is being switched to being provided as the "depot" argument
instead.
Change-Id: I7e011fe5c44ac3e4142177afd168f1bbc602d56f
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2764
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
Previously the depot argument was provided as config.depot, but the "new
way" of doing things (which is more like the args list provided in the
rest of the depot) is to provide this as the "depot" NixOS module
argument instead.
Change-Id: Ib48b1c7c1bdff9c1eb0618c6cbacc22b651f5f98
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2763
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Reviewed-by: glittershark <grfn@gws.fyi>
The depot.nix module is automatically brought in by systemFor, and
shouldn't be included in user configs, since it's going away.
Change-Id: Ib5b60203978b51dbff1f7bcc287f2ac9eb278823
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2762
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
ops.nixos.nixosFor is intended to provide the "basic" readTree-like
system arguments to NixOS systems; in particular, it provides "depot" as
a module argument, as well as, for the moment, config.depot.
Change-Id: I442c7d79ac0eb2ff8e1bf606f4e083e15eb0a8f4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2761
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
For the moment I've opted to not import all of the other things we'd
usually provide to things imports via readTree, because I think it's a
bit dangerous to accidentally overwrite things like NixOS' notion of
"lib" with our own version.
So for the moment, baseModule provides only "depot".
Change-Id: I3db9132a3d9227055d4c1b00f02effcb84edcc53
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2760
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
This drops the annoying usage of builtins.currenTime, which means that
my website stops constantly rebuilding.
Change-Id: I44294b06588673846f473beb6533a5fa3410a1bd
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2767
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
Fixes a long-standing todo by adding an additional field for the time
at which a post was updated, and handling this in both site
generation (to note the update date after the publish date) and in
Atom feed generation (by populating both the updated and published
fields).
Change-Id: If80db43459b2a0c77eea4dde7255651b5d6cd64b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2766
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
This is not for the domain root though, as that's going to be
something else eventually.
The canonical URLs are the .fyi ones (at least for now), and some of
these tools will eventually generate links that make user sessions
started from *.tvl.su converge on *.tvl.fyi.
Relates to b/98
Change-Id: I1c3bcf72a3063059002e4b0bdd57c269a410a8bc
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2758
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
Decreased text width for the /about pages should increase readability
considerably as jumping back to the beginning is hard for longer
lines. The result is still not perfect as the font size for the /about
pages is rather small and many lines thus get broken somewhat awkwardly.
We could probably migitate that using a larger font size.
The implementation choice of adding a tvl-extra.css which we inject into
cgit.css in preBuild is for simplicity: We don't need to worry about
routing an extra CSS file and loading it from the right location via
extra cgit head entries and serving it at the correct location using
either nginx or thttpd.
A drawback of this is however that iteration is slowed down by cgit's
compilation time.
Additionally, this should be the basis for implementing a bubblegum
themed cgit for Profpatsch.
Change-Id: I18060f735167acd623cef7a17c83408978461249
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2756
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
I am somewhat trustworthy… maybe? Also I tend to gc depot stuff so ssh
serve would be neat.
Change-Id: I4672f20a32a756692dd156b5e40e5a7f37ba5ad0
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2660
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Reviewed-by: glittershark <grfn@gws.fyi>
This gives a decent compilation speedup even on slow machines, so seems
worth it. Let's hope the cgit build process is not racy.
Change-Id: Ic4ae72789da2ccae16fd48e46aec624244b25035
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2755
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
More or less direct port of https://dotti.me to mdoc(7) with the
following changes:
* Add a RFC3339 column to the EXAMPLES table. RFC3339 is a well
specified subset of ISO8601 whose specification is also more
accessible so this could help someone out.
* Add a SEE ALSO section linking to the web site
* Add an AUTHORS section
Change-Id: I8db00bd402697aa52f6f651f28692617b487f832
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2642
Tested-by: BuildkiteCI
Reviewed-by: edef <edef@edef.eu>
Forgot to add this when moving it out of my //users directory.
Change-Id: If6d30a2a58a6bd73e160706cb706e3b2e100e909
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2754
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
So here is what has been keeping me up at night: At some point I
realized that nix actually made a somewhat passable language for CGI
programming:
* That `builtins.getEnv` exists as one of the impurities of Nix is
perfect as environment variables are the main way of communication
from the web server to the CGI application.
* We can actually read from the filesystem via builtins.readDir and
builtins.readFile with bearable overhead if we avoid importing the
used paths into the nix store.
* Templating and routing are convenient to implement via indented strings
and attribute sets respectively.
Of course there are obvious limitation:
* The overhead of derivations is probably much to great for them to be
useful via IfD.
* Even without derivations, nix evaluation is very slow to the point
were a trivial application takes between 100ms and 400ms to produce a
response.
* We can't really cause effects other than producing a response which
makes it not viable for a lot of applications. There are some ways
around this:
* With a custom interpreter we could have streaming and multiplexed
I/O (using lazy lists emulated via attrsets) to cause such effects,
but it would probably perform terribly.
* We can use builtins.fetchurl to call other HTTP-based microservices,
but only in very limited constraints, i. e. only GET, no headers,
and only if the tarball ttl is set to 0 in the global nix.conf.
* Terrible error handling capabilities because builtins.tryEval actually
doesn't catch a lot of errors.
To prove that it actually works, there are some demo applications,
which I invite you to run and potentially break horribly:
nix-build -A web.bubblegum.examples && ./result
# navigate to http://localhost:9000
The setup uses thttpd and executes the nix CGI scripts using
users.sterni.nint which automatically passed `depot`, so they can
import the cgi library.
Change-Id: I3a22a749612211627e5f8301c31ec2e7a872812c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2746
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
nint (short for nix interpreter) is a tiny wrapper around nix-instantiate
which allows to run nix scripts, i. e. nix expressions that conform to
a certain calling convention. A nix script runnable using nint must
conform to the following constraints:
* It must evaluate to a function which has a set pattern with an
ellipsis as the single argument.
* It must produce a string as a return value or fail.
When invoked, a the expression receives the following arguments:
* `currentDir`: the current working directory as a nix path
* `argv`: a list of strings containing `argv` including `argv[0]`
* extra arguments which are manually specified which allows for
passing along dependencies or libraries, for example:
nint --arg depot '(import /depot {})' my-prog.nix [ argv[1] … ]
would pass along depot to be used in `my-prog.nix`.
Such nix scripts are purely functional in a sense: The way inputs can be
taken is very limited and causing effects is also only possible in a
very limited sense (using builtins.fetchurl if TARBALL_TTL is 0,
adding files and directories to the nix store, realising derivations).
As an approximation, a program executed using nint can be thought of
as a function with the following signature:
λ :: environment → working directory → argv → stdout
where environment includes:
* the time at the start of the program (`builtins.currentTime`)
* other information about the machine (`builtins.currentSystem` …)
* environment variables (`builtins.getEnv`)
* the file system (`builtins.readDir`, `builtins.readFile`, …) which
is the biggest input impurity as it may change during evaluation
Additionally import from derivation and builtin fetchers are available
which introduce further impurities to be utilized.
Future work:
* Streaming I/O via lazy lists. This would allow usage of
stdin and output before the program terminates. However this would
require using libexpr directly or writing a custom nix interpreter.
A description of how this would work can be found on the website of the
esoteric programming language Lazy K: https://tromp.github.io/cl/lazy-k.html
* An effect system beyond stdin / stdout.
* Better error handling, support setting exit codes etc.
These features would require either using an alternative or custom
interpreter for nix (tvix or hnix) or to link against libexpr directly
to have more control over evaluation.
Change-Id: I61528516eb418740df355852f23425acc4d0656a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2745
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
This also looks much cleaner than before.
Change-Id: I767b881c73699151afc03746c04e413e74f30387
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2750
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
This modifies the capture regex executed by `jq` to capture the TODO
text itself as a separate capture group, which is then used for the
content of the TODO listing.
The web listing looks much cleaner this way.
Change-Id: I00a14da57b315a353f700c112ba33f38e16f1f85
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2749
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
The way this loads the api key is a hack, but also... I don't care!
Change-Id: I4d417b1a824007620661188b60b21a1f73867dca
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2747
Reviewed-by: glittershark <grfn@gws.fyi>
Tested-by: BuildkiteCI
We use builtins.split directly as it should be a bit more efficient as
lib.splitStrings. Also its returning of a list for every regex match is
useful to update the state while parsing the tokens:
* The tokens are obtained by splitting the string at every '%'
* Everytime we see a boundary (that is a list in the returned
list of builtins.split), we know that the first two chars of
the next string are a percent encoded character.
One implementation flaw is that it will currently crash if it encounters
mal-formed URLs (since int.fromHex chrashes if it encounters any non
hex digit characters) and accepts some malformed urlencoding like
"foo %A".
Change-Id: I90d08d7a71b16b4f4a4879214abd7aeff46c20c8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2744
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
`hii` is a derived rewrite of suckless’s `ii`.
It is not backwards compatible.
Change-Id: Ife2a43863b5b6ba38333d7ae5f2cb9bd4787b5fc
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2706
Tested-by: BuildkiteCI
Reviewed-by: lukegb <lukegb@tvl.fyi>
Reviewed-by: sterni <sternenseemann@systemli.org>
About to do some dhalllll! \o/
Change-Id: Ie58c335d80f4a5abeb8296ece5a24377f07e6369
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2585
Tested-by: BuildkiteCI
Reviewed-by: lukegb <lukegb@tvl.fyi>
In order to arbitrarily split netencode over multiple reads, we need
to make the parser completely streaming, so that it recognizes all
cases where it needs more input.
Luckily, this is fairly trivial, after working around a bunch of
overeager parsing.
The tricky part was the giant `alt`, where inner parsers would start
consuming input and thus become incomplete when they fail afterwards.
Sinc the format *always* starts the different types with one
discriminator char, we can use that to instantly return the parser and
try the next one instead.
The other tricky part was that lists and records would parse all inner
elements and then choke on the empty string after the last element,
because the inner parser would consume at least the descriminator, and
an empty string is always `Incomplete`. We wrap these into a small
combinator which plays nice with `many0` in that regard.
Change-Id: Ib8d15d9a7cab19d432c6b24a35fcad6a5a72b246
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2704
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
Reviewed-by: sterni <sternenseemann@systemli.org>
This is a quick hack to make it possible to view the rendered SVG on
https://code.tvl.fyi/about/tvix/docs/components.md
We want to be able to do this sort of thing dynamically in the future,
but we can't yet, so ... well. Deal with it.
Change-Id: Id2b819679d748b6f517018a9c6e72d5c1d806c4c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2743
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Very simple builder which builds (optionally) gzipped man pages from a
list of attrsets and links them into a common man directory with the
correct layout, so it should be installable immediately.
Additionally runs mandoc -T lint, but by default only for informational
purposes as it is very strict and some things are almost never true (for
example all Xrs being present in the respective directory).
buildManPages.single exposes the internal builder for a single,
optionally gzipped man page from a nix attrset.
Change-Id: I43fce011716f4a7cc80521f222800ca99ba54060
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2654
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
We also want to access the produced SVGs separately.
Change-Id: I5bdfd95b8a56323ed8bf5f4585b703f6e728c677
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2742
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Most other docs folders in the repo are called `doc` too, let's make
this consistent.
Change-Id: Icd712429b51763076548c977321e370f2a77877e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2741
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
* general editing
* reflowed text to fit on my screen :p
Change-Id: I1ae41ef5524d3174d063c66a7bcb990808424bdb
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2716
Tested-by: BuildkiteCI
Reviewed-by: adisbladis <adisbladis@gmail.com>
This chops off "front matter", which we have - for example - in Tvix
documentation that is rendered through Pandoc.
Change-Id: I65c7a4ad8171423a50aaf47c046dab8c774346d8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2717
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Covers some of the odd things we do, specifically callouts and code
rendering.
Change-Id: Ib8542373b434b53d277b0d8c9ddb78ac7c5176a5
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2689
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
This reverts commit 3b05be2fd0.
Reason for revert: Sourcegraph still does not support fetching arbitrary refs, so we'll have to wait until its Gerrit integration lands before this will work correctly.
Change-Id: Icee82c50f92c34ba1741b608449aed16538ccbaa
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2721
Tested-by: BuildkiteCI
Reviewed-by: lukegb <lukegb@tvl.fyi>
These were actually just copy&pasted from the layout of my
blog (//users/tazjin/blog), even including a dead link.
This commit adds more relevant links instead.
Change-Id: Ib55aac492f1f9bff650edfa43b52d3d5d611410c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2713
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
This was originally done when "the purge" happened, and I don't think
it's quite accurate anymore.
This reverts commit 94846503c5.
Change-Id: I4be2bccfa68505a2f663ab1695e547321d2dd0b8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2709
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI