I may have broken the run-liminix-vm command a bit for MIPS due to
necessary changes in how we pass the command line. If CI isn't green
for this commit and youre trying the worked examples, I suggest
reverting to the commit before this one.
The second parameter is now an options attrset, wherein we will pile
all kinds of cool stuff.
Right now the only cool bit is `mainFunction`, which allows you to
compile a fennel module into a lua script and name the function that
should be executed when the script runs. This makes it easier to
write testable Fennel code, because the test script can require the
module and call stuff in it.
this means fennelrepl in nix-shell will prefer local
source files to generated lua files, making it easier
to change library code without restarting the shell
This requires adding LFS as a dependency because native Lua has
no way to iterate a directory, but it seems to be Not Huge and
hopefully we'll have other uses for it
This is in preparation for writing something that extracts them
into documentation.
user configurations now call config.system.service.foo.build { ...params }
instead of config.system.service.foo
the parameter type definitions themselves now move into the
config stanza of the module referencing the service
new helper function liminix.callService
The only service moved so far is dnsmasq
We use (abuse, arguably) the nixos module system for typechecking. Un
the plus side, it gives us documentation of the options and their
expected types. On the downside, the error message doesn't tell us
the file in which the error was encountered.
(This is subject to change, if I can find a better way)
Runs fennel using a Lua compiled with the same options as the
host system, and with packages set up so it can find all the local
Lua packages
To shorten the dev feedback loop further, allows FENNEL_PATH to be set
on the command line so you can point directly it at the Fennel sources
for some library you're working against instead of having to run
nix-build and compile them to Lua
Previously: the service wrote a timestamp and the receiver
read and parsed it to see if there was new data
Now: the service writes and removes a .lock file to prevent
the receiver reading partial data. The receiver is responsible
for remembering the *previous* state and only updating if it's changed
this is step 1 of min-collect-garbage, no point implementing
deletion ourselves when rm -r exists
(arguably no point in implementing any of it, but this is the bit we
can't do efficiently in bourne shell - it means we're reading the
store-paths list once instead of grepping it afresh for every entry in
/nix/store/)
By using the kernel "nolibc" header to avoid requiring a C library, we
can bring the initramfs size to around 4k
This does involve a tiny bit of inline mips assembly which I'm not
sure about. gcc seems unwilling to generate the code to load $gp at
function entry of main(), so we do it by hand - but I'd rather find
out why gcc doesn't.
systemconfig (a.k.a "activate") is run from the initramfs. Converting
it from a shell script to an executable means it doesn't depend on
there being a shell in the initramfs
the jffs2 filesystem contains only /nix/store and a script which is
run in early init (initramfs) and is responsible for recreating
"traditional" directories (/bin /etc/**/* /var &c) based on the
configuration.
this is tested only in qemu so far and could use some cleanup
we'd like a bit more of the convenience of mksquashfs
(never thought I'd say _that_) for jffs2, in particular
not having to copy all the desired store paths into a
single directory just so we can create an image from them
We now use MIPS_CMDLINE_DTB_EXTEND for all boot varieties
(tftpboot, flash boot, kexec) with the addition of
MIPS_BOOTLOADER_CMDLINE_REQUIRE_COOKIE - local patch -
so that the bootloader args are ignored unless they
contain the string "liminix"