* Update attribute names in code examples (* -> settings.*).
* Use `nix-shell -p` rather than `nix run` because the example won't
work with the current default Nix.
* Update config values for `element-web`.
* Fix link to `element-web` security considerations.
* Make the synapse expression even smaller and use callout-lists to
explain the code.
* Document how to correctly deploy the shared registration secret.
[1] https://spec.matrix.org/latest/client-server-api/#getwell-knownmatrixclient
To avoid duplicating the ruby compilation code, this change exposes two
functions `mkRubyVersion` and `mkRuby`, which can be used in an overlay
to build any past or current ruby version.
An example overlay:
```nix
self: super:
{
ruby_2_7_6 = super.mkRuby {
version = super.mkRubyVersion "2" "7" "6" "";
sha256 = "042xrdk7hsv4072bayz3f8ffqh61i8zlhvck10nfshllq063n877";
};
ruby_3_1_2 = super.mkRuby {
version = super.mkRubyVersion "3" "1" "2" "";
sha256 = "0gm84ipk6mrfw94852w5h7xxk2lqrxjbnlwb88svf0lz70933131";
};
}
```
Without the change archimedes fails to build with latest toolchains as:
ld: archimedes.c:(.text+0xdac7): undefined reference to `rnd'
ld: archimedes.c:(.text+0xdeab): undefined reference to `rnd'
ld: archimedes.c:(.text+0xdf13): undefined reference to `rnd'
ld: archimedes.c:(.text+0xe3ef): undefined reference to `rnd'
ld: archimedes.o:archimedes.c:(.text+0xe456): more undefined references to `rnd' follow
ld: archimedes.o: in function `EMC':
archimedes.c:(.text+0xf11b): undefined reference to `creation'
ld: archimedes.c:(.text+0xf5f5): undefined reference to `creation'
ld: archimedes.c:(.text+0xf826): undefined reference to `creation'
ld: archimedes.c:(.text+0xf9ce): undefined reference to `creation'
The change happens to fix build against clang as well.
In Nixpkgs, we assume that the "config" field is a canonicalized GNU
triple. I noticed that non-canonical values were being used here,
because the pkgsCross.mips64el-linux-gnu triples did not contain the
vendor field, but the pkgsCross.mips64el-linux-gnu.pkgsStatic did.
Here, I've run all the MIPS triples in lib.systems.examples through
config.sub to canonicalize them. I think this will avoid nasty
surprises in future.
Tested by building Nix and the bootstrap files for
pkgsCross.mips64el-linux-gnu.