Go to file
Daniel Barlow 45025f128a switch to s6-linux-init and s6-rc
This is at the point where it runs a getty and a pile of s6-supervise
processes, though it doesn't seem to run the things being supervised
2022-09-21 23:01:21 +01:00
devices boots to userland and runs busybox init 2022-09-20 23:04:08 +01:00
pkgs switch to s6-linux-init and s6-rc 2022-09-21 23:01:21 +01:00
tests switch to s6-linux-init and s6-rc 2022-09-21 23:01:21 +01:00
tools generate a mips squashfs with some s6-rc services 2022-09-19 23:51:38 +01:00
.gitignore placeholder readme 2022-09-20 15:46:42 +01:00
README.md switch to s6-linux-init and s6-rc 2022-09-21 23:01:21 +01:00
default.nix boots to userland and runs busybox init 2022-09-20 23:04:08 +01:00
make-image.nix switch to s6-linux-init and s6-rc 2022-09-21 23:01:21 +01:00
make-kernel.nix boots to userland and runs busybox init 2022-09-20 23:04:08 +01:00
make-vmlinux.nix build a kernel, using malta_kvm_defconfig 2022-09-20 18:54:27 +01:00
overlay.nix switch to s6-linux-init and s6-rc 2022-09-21 23:01:21 +01:00
run-qemu.sh boots to userland and runs busybox init 2022-09-20 23:04:08 +01:00
run-tests.sh build a kernel, using malta_kvm_defconfig 2022-09-20 18:54:27 +01:00

README.md

Liminix

A Nix-based system for configuring consumer wifi routers.

What is this?

This is a Nix-based collection of software tailored for domestic wifi router or IoT device devices, of the kind that OpenWrt or DD-WRT or Gargoyle or Tomato run on. It's a reboot/restart/rewrite of NixWRT.

This is not NixOS-on-your-router: it's aimed at devices that are underpowered for the full NixOS experience. It uses busybox tools, musl instead of GNU libc, and s6-rc instead of systemd.

The Liminix name comes from Liminis, in Latin the genitive declension of "limen", or "of the threshold". Your router stands at the threshold of your (online) home and everything you send to/receive from the outside word goes across it.

Building

These instructions assume you have nixpkgs checked out in a peer directory of this one.

You need a configuration.nix file pointed to by <liminix-config>, a hardware device definition as argument device, and to choose an appropriate output attribute depending on what your device is and how you plan to install onto it. For example:

NIX_PATH=nixpkgs=../nixpkgs:$NIX_PATH NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nix-build -I liminix-config=./tests/smoke/configuration.nix --arg device "import ./devices/qemu.nix" -A outputs.default

outputs.default is intended to do something appropriate for the device, whatever that is. For the qemu device, it creates a directory containing a squashfs root image and a kernel, with which you could then run

./run-qemu.sh result/vmlinux result/squashfs

Running tests

Assuming you have nixpkgs checked out in a peer directory of this one,

NIX_PATH=nixpkgs=../nixpkgs:$NIX_PATH ./run-tests.sh

Articles of interest

  • Build Safety of Software in 28 Popular Home Routers: "of the access points and routers we reviewed, not a single one took full advantage of the basic application armoring features provided by the operating system. Indeed, only one or two models even came close, and no brand did well consistently across all models tested"

s6/ directory has the result of running s6-linux-init-maker, plus edits to the scripts for s6-rc

  • need to fix the bin/ directory (maybe they were copied from s6-linux-init?)

  • maybe the run-image directory can be added as a squashfs source directory?