From 47c370f495a4b092fdca05f25683d2f7024e89fb Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 22 Nov 2026 11:47:48 +0000 Subject: base/systemd.nix: a slimmer systemd, optional nixpkgs' systemd comes with much a guest has no use for: importd (with gnupg and openldap), cryptsetup, TPM2, FIDO2, homed, repart, sysupdate, portabled, machined, nspawn and vmspawn, journal-remote (microhttpd, gnutls), coredump (elfutils), BPF (libbpf), qrencode, pwquality, AppArmor. And dbus brings in a second systemd, systemd-minimal (23M), X11's libraries, and AppArmor, too. Leaving all that out means building systemd, dbus and dbus-broker (which links libsystemd) from source, on every nixpkgs bump, so it's a base module (--arg base '[ base/systemd.nix ]'), for whoever thinks that's worth it. NixOS leaves out the units of what the package lacks; coredump the base system turns off already, and the module takes systemd-bsod out of the initrd (where NixOS has it unconditionally), as systemd builds it only with qrencode. --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 9746906..3210c9e 100644 --- a/README.md +++ b/README.md @@ -208,6 +208,15 @@ nix-build pkgs/run-firecracker-vm \ --arg base '[ base/kernel.nix ]' ``` +And for a slimmer systemd (no importd, homed, machined, nspawn, +cryptsetup, TPM2, FIDO2, journal-remote, ...), built from source, with +dbus and dbus-broker against it: + +```sh +nix-build pkgs/run-firecracker-vm \ + --arg base '[ base/kernel.nix base/systemd.nix ]' +``` + ## Egress The guests resolve every name to the host, and all their HTTPS goes to @@ -287,6 +296,7 @@ the list its own VM uses. - `pkgs/run-firecracker-vm/default.nix`: the guest's NixOS configuration, the Firecracker configuration, and the `run-firecracker-vm` script. - `base/kernel.nix`: the cut-down kernel, for `base`. +- `base/systemd.nix`: a slimmer systemd, for `base`. - `layers/nix.nix`: nix, as a layer. - `layers/console.nix`: a shell on the serial console, to import into a layer. - `modules/host/default.nix`: the host's side: network, DHCP/DNS, egress -- cgit v1.3.1