diff options
| author | tv <tv@krebsco.de> | 2026-11-21 05:19:09 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-21 05:19:09 +0000 |
| commit | 0c8d9e30cb8fb9b42d1093540a2b73901c770fc5 (patch) | |
| tree | 0a9d0b57c20eb2d7cdb629ed02d6199b007e7971 /pkgs/run-firecracker-vm | |
| parent | 5e77974dc9953b162610b6c3bc0a1362c72cf291 (diff) | |
layers/console.nix: a shell on the serial console, to import into a layer
Since the base system turned off the console (and with it kbd), it had
no getty at all: NixOS's gettys come with the console
(services/ttys/getty.nix), so there was no shell on ttyS0 any more, only
the kernel's and systemd's messages, and ssh. That stays the default,
and the base system's console.enable is only that now, a default, for
layers/console.nix: the console, with root logged in on ttyS0 (a
default, too: services.getty.autologinUser can name another user, or be
null for a login prompt), but no getty on tty1, and no
systemd-vconsole-setup, which moved there from the base system, like
the autologin. It's small, so the README has it imported into another
layer, rather than as a layer, with an image, of its own, which works,
too.
Diffstat (limited to 'pkgs/run-firecracker-vm')
| -rw-r--r-- | pkgs/run-firecracker-vm/default.nix | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/pkgs/run-firecracker-vm/default.nix b/pkgs/run-firecracker-vm/default.nix index a8b3a92..c8a77e5 100644 --- a/pkgs/run-firecracker-vm/default.nix +++ b/pkgs/run-firecracker-vm/default.nix @@ -134,8 +134,6 @@ let (pkgs.runCommand "mount.vsock9p" { } "install -D ${mountVsock9p} $out/bin/mount.vsock9p") ]; - services.getty.autologinUser = "root"; - # sshd, started on demand (a layer may turn that off), with the host # key the run script serves via 9P on vsock port 567 (--ssh-host-key; # not in the store), copied to /run/ssh before sshd (or its socket) @@ -167,7 +165,6 @@ let rmdir "$share" ''; }; - systemd.targets.getty.wants = lib.mkForce [ ]; # no getty on tty1 # A fixed machine-id, so systemd doesn't consider every boot the first. environment.etc.machine-id.text = builtins.hashString "md5" "firecracker" + "\n"; @@ -220,8 +217,9 @@ let # 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; + # database. No console means no getty either, not even on ttyS0: + # the way in is ssh, or layers/console.nix. + console.enable = lib.mkDefault false; fonts.fontconfig.enable = false; security.pam.services.su.forwardXAuth = lib.mkForce false; environment.etc."udev/hwdb.bin".enable = false; |
