Systemd-vconsole-setup failed

the service won’t start with the following in my configuration.nix:

   i18n.defaultLocale = "en_US.UTF-8";
   console = {
     font = "ter-v16n";
     keyMap = "us";
     earlySetup = true;
 #   useXkbConfig = true; # use xkb.options in tty.
   };
  systemd.services.systemd-vconsole-setup.unitConfig.After = "local-fs.target";

...

fonts.packages = with pkgs; [terminus_font];

/run/current-system/sw/share/consolefonts doesn’t exist and isn’t created by the command environment.etc."consolefonts".source = pkgs.terminus_font + "/share/consolefonts"; so I don’t see any immediate methods of fixing this service that doesn’t start with systemctl start systemd-vconsole-setup

/nix/store/s9xi2nyd120c9f6xmppb4ajf5qhvb87i-terminus-font-4.49.1/share/consolefonts/ter-v16n.psf.gz exists and nix eval --raw nixpkgs#terminus_font output is
/nix/store/4n9drqmlig140lsac6m1m0pf3rgw5axh-terminus-font-4.49.1

░░ 
░░ The job identifier is 75292 and the job result is failed.
Nov 15 00:12:58 nixos systemd[1]: Starting Virtual Console Setup...
░░ Subject: A start job for unit systemd-vconsole-setup.service has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit systemd-vconsole-setup.service has begun execution.
░░ 
░░ The job identifier is 76750.
Nov 15 00:12:58 nixos systemd-vconsole-setup[1058821]: setfont: ERROR setfont.c:435 kfont_load_font: Unable to find file: ter-v16n
Nov 15 00:12:58 nixos systemd-vconsole-setup[1058819]: /nix/store/lg2d61sdx975f1brx00bc9fahj2hvr2a-kbd-2.9.0/bin/setfont failed with exit >
Nov 15 00:12:58 nixos systemd-vconsole-setup[1058819]: Configuration of first virtual console failed, ignoring remaining ones.
Nov 15 00:12:58 nixos systemd[1]: systemd-vconsole-setup.service: Main process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ An ExecStart= process belonging to unit systemd-vconsole-setup.service has exited.
░░ 
░░ The process' exit code is 'exited' and its exit status is 1.
Nov 15 00:12:58 nixos systemd[1]: systemd-vconsole-setup.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit systemd-vconsole-setup.service has entered the 'failed' state with result 'exit-code'.
Nov 15 00:12:58 nixos systemd[1]: Failed to start Virtual Console Setup.
░░ Subject: A start job for unit systemd-vconsole-setup.service has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit systemd-vconsole-setup.service has finished with a failure.
░░ 
░░ The job identifier is 76750 and the job result is failed.
lines 302-338/338 (END)```

First of all, remove this. You are not experiencing this bug; that bug is extraordinarily obscure and I am very certain this line isn’t a real fix for that problem anyway.

Anyway, you’re configuring the wrong font option. You should add terminus_font to console.packages, not fonts.packages. The fonts.packages option adds fonts for GUI font systems, while console.packages is described as “List of additional packages that provide console fonts, keymaps and other resources for virtual consoles use.”

1 Like

console.packages = with pkgs; [terminus_font]; fixed it

idek what systemd-vconsole-setup does - /run/current-system/sw/share/consolefonts still doesn’t exist but “reloading the following units: reload-systemd-vconsole-setup.service” appears in nixos-rebuild switch --upgrade-all output and systemctl status systemd-vconsole-setup reload-systemd-vconsole-setup says active (exited) in green text for both so it appears to be resolved now!

Yea systemd-vconsole-setup is using setfont which is using /etc/kbd/consolefonts/. Things don’t need to be in /run/current-system/sw/share/consolefonts/ (though many systems do have that directory for no reason thanks to DEs probably shouldn't link `/share` · Issue #47173 · NixOS/nixpkgs · GitHub).

1 Like