aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs/run-firecracker-vm/default.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-21 05:10:40 +0000
committertv <tv@krebsco.de>2026-11-21 05:10:40 +0000
commit5e77974dc9953b162610b6c3bc0a1362c72cf291 (patch)
tree845bff89e7f72a203f41faa430f32a69a16f99c6 /pkgs/run-firecracker-vm/default.nix
parent9c6d26a412be3b91c5e24c7f080da2d35f7b226d (diff)
run-firecracker-vm: no console, fontconfig, su xauth, hwdb, shutdown ramfs
The guest has no screen, no X, and no hardware to tell apart but virtio, so the base system leaves out kbd and systemd-vconsole-setup (console.enable; the unit doesn't need disabling any more), fontconfig and freetype, su's xauth with libX11 & co. (which shadow.nix turns on, not as a default), and udev's hardware database (14M). And there's nothing to unmount from a ramfs at shutdown: / is a tmpfs, and the store's images are read-only; systemd-shutdown remounts what's still busy, like the rw-store, read-only. About 30M less in the base image, and a service less at every shutdown.
Diffstat (limited to 'pkgs/run-firecracker-vm/default.nix')
-rw-r--r--pkgs/run-firecracker-vm/default.nix14
1 files changed, 13 insertions, 1 deletions
diff --git a/pkgs/run-firecracker-vm/default.nix b/pkgs/run-firecracker-vm/default.nix
index dbdf2b6..a8b3a92 100644
--- a/pkgs/run-firecracker-vm/default.nix
+++ b/pkgs/run-firecracker-vm/default.nix
@@ -217,6 +217,19 @@ let
systemd.tpm2.enable = false;
users.manageLingering = false;
+ # No screen, no X, and no hardware to tell apart, but virtio:
+ # neither kbd and systemd-vconsole-setup, nor fontconfig, nor su's
+ # xauth (shadow.nix sets it, not as a default), nor udev's hardware
+ # database.
+ console.enable = false;
+ fonts.fontconfig.enable = false;
+ security.pam.services.su.forwardXAuth = lib.mkForce false;
+ environment.etc."udev/hwdb.bin".enable = false;
+ # Nothing to unmount from a ramfs at shutdown: / is a tmpfs, and the
+ # store's images are read-only (systemd-shutdown remounts what's
+ # still busy, like the rw-store, read-only).
+ systemd.shutdownRamfs.enable = false;
+
# /var is empty on every boot, which makes these run every time,
# in the critical path to sysinit.target.
systemd.suppressedSystemUnits = [
@@ -238,7 +251,6 @@ let
"sys-kernel-debug.mount"
"sys-kernel-tracing.mount"
"systemd-pstore.service"
- "systemd-vconsole-setup.service"
] (_: { enable = lib.mkForce false; });
# Of the generators systemd runs after switching root, only fstab and