Commit Graph

28 Commits

Author SHA1 Message Date
Victor Engmark
3a6c79cff6 nixos/x11: refactor XKB options into a single attrset
[Motivation](https://github.com/NixOS/nixpkgs/issues/257817#issuecomment-1741705042):

- Having all the XKB options in the same attribute set clarifies their
  relation better than using a common option name prefix ("xkb").
- `services.xserver.layout` is an XKB option, but this is not obvious
  from its name. Putting it with the other XKB options clarifies this.

Co-authored-by: Michele Guerini Rocco <rnhmjoj@users.noreply.github.com>
2023-10-11 09:46:37 +03:00
Raito Bezarius
79c3740ee5 nixos/console: use systemd-vconsole-setup.service from upstream for sd initrd
This fixes a bug where the vconsole was not working as intended in systemd stage 1 with systemd v254.

udev rules are now starting with this service instead of whatever happened before.
2023-09-13 12:02:40 +02:00
K900
39c344c893 nixos/console: let the kernel pick the default font 2023-03-21 13:29:57 +01:00
novenary
5bb65387bf console: support using in-kernel fonts 2023-01-24 11:19:46 +02:00
Sandro Jäckel
5f03b6ddfc
nixos/console: move enable option out of let in 2022-11-12 23:40:20 +01:00
Yureka
bb5b6029aa
Revert "nixos/console: detect unicode properly"
This reverts commit 05958b228b.

Issue https://github.com/NixOS/nixpkgs/issues/188998 is concerns quite a
few NixOS users with full disk encryption and custom keymap.
Since there hasn't been a proper fix agreed upon and merged, I am
reverting this.
The changes can be applied again, when it is ensured that they do not
break custom keymaps in initrd.
2022-09-08 23:11:45 +02:00
Naïm Favier
cb40619996
nixos/console: add format check to console.colors 2022-09-04 21:09:08 +02:00
Weijia Wang
05958b228b nixos/console: detect unicode properly 2022-08-25 11:38:47 +00:00
pennae
6b13dd0e9e
Merge pull request #183491 from pennae/automatic-md-conversions
treewide: automatically md-convert option descriptions
2022-08-02 02:15:30 +02:00
pennae
2e751c0772 treewide: automatically md-convert option descriptions
the conversion procedure is simple:

 - find all things that look like options, ie calls to either `mkOption`
   or `lib.mkOption` that take an attrset. remember the attrset as the
   option
 - for all options, find a `description` attribute who's value is not a
   call to `mdDoc` or `lib.mdDoc`
 - textually convert the entire value of the attribute to MD with a few
   simple regexes (the set from mdize-module.sh)
 - if the change produced a change in the manual output, discard
 - if the change kept the manual unchanged, add some text to the
   description to make sure we've actually found an option. if the
   manual changes this time, keep the converted description

this procedure converts 80% of nixos options to markdown. around 2000
options remain to be inspected, but most of those fail the "does not
change the manual output check": currently the MD conversion process
does not faithfully convert docbook tags like <code> and <package>, so
any option using such tags will not be converted at all.
2022-07-30 15:16:34 +02:00
Linus Heckemann
bb7f88ccc0
Merge pull request #178529 from oxalica/fix/systemd-initrd-vconsole
nixos/console: add required store paths to initrd for systemd stage 1
2022-07-30 10:15:14 +02:00
oxalica
3562c1d5c6 nixos/console: add required store paths to initrd for systemd stage 1
`console.{font,keyMap}` may be a path or a string to a store path,
which should be added to initrd for `systemd-vconsole-setup` before
the prompt for the LUKS password.
2022-06-22 11:55:58 +08:00
pennae
320aa2a791 treewide: attempt at markdown option docs 2022-06-12 12:44:38 +02:00
Bernardo Meurer
b29e3bb892
nixos/console: inird -> initrd 2022-04-30 14:43:09 -07:00
Janne Heß
18363cad97
nixos/console: Allow setting keymap without font 2022-04-30 11:22:08 +02:00
Janne Heß
0efb6720a4
nixos/console: Fix attribute path to fix eval 2022-04-14 22:07:41 +01:00
Janne Heß
6d6c1c341c
nixos/stage-1-systemd: Add keymap support
Makes my life a lot easier with my non-american keyboard layout
2022-04-14 10:25:04 +01:00
Julien Moutinho
661207ce7e nixos/console: fix cross-compiling 2021-10-20 02:15:09 +02:00
rnhmjoj
e4da1edf8b
nixos/extra-layouts: avoid all rebuilds
Just setting the XKB_CONFIG_ROOT should be enough, so we don't need to
rebuild the xserver, xkbcomp and other packages anymore.
However, the variable has to be passed explicitely to scripts running at
build time: in particular to xkbvalidate and xkb-console-keymap.
2021-09-17 01:48:46 +02:00
Naïm Favier
39bc736382
nixos/console: allow console.font to be a path
As for console.keyMap, all uses of this option are compatible with paths. This allows doing things like `console.font = pkgs.runCommand ...`.
2021-06-12 13:24:32 +02:00
davidak
fabdd46503 kbdKeymaps: remove
dvp and neo are now included in kbd

includes documentation in release notes and alias
2021-04-23 16:41:06 +02:00
rnhmjoj
9be0529210
nixos/console: fix console setting reloading
It's a dull and boring day, it's cold outside and I'm stuck at home: let
me tell you the story of systemd-vconsole-setup.

In the beginnings of NixOS[1], systemd-vconsole-setup was a powerful
sysinit.target unit, installed and running at boot to set up fonts
keyboard layouts and even colors of the virtual consoles. If needed, the
service would also be restarted after a configuration change, consoles
were happy and everything was good, well, almost.

Since the service had no way to specify the dependency "ttys are ready",
modesetting could sometimes happen *after* systemd-vconsole-setup had
started, leaving the console in a broken state. So abbradar worked
around that by putting a systemd-udev-settle `After=`.

In the meanwhile, probably realizing their mistake, systemd added a
shiny udev rule to start the systemd-udev-settle at the right time[2].
However, the rule bypassed systemd by directly running the binary
`systemd-udev-settle`, and the service - though still installed - fell
into disuse.

Two years would pass before a good samaritan, seeing the poor jobless
systemd-udev-settle service, decided to give it the coup de grâs[3] by
unlisting it from the installed units.
This, combined with another bug, caused quite a commotion[4] in NixOS;
to see why remember the fact that `WantedBy=` in upstream units doesn't
work[5], so it had to be added manually in cc542110, but while systemd
removed it, the NixOS unit continued to install and restart the service,
making a lot of fuss when switching configuration.

After at least thee different tentative fixes, deedrah realised[6] what
the root cause was and fpletz put the final nail[7] in the coffin of
systemd-udev-settle. The service would never see the light of a boot
again, NixOS would not restart it all the time but thanks to udev
consoles would still get their pretty fonts and playful colors.

The En..

..no, wait! You should ask what came of systemd-udev-settle, first.
And why is the service even around if udev is doing all the work?

Udev-settle, like the deceitful snake that he is, laid hidden for years.
He looks innocuous doesn't it? A little hack. Only until it leaves his
den and a poor user[8] drops dead. Obviously, it serves no purpose, as
the service is not part of the boot process anymore, so let's remove it
for good!

About the service, it may not be useful at boot, but it can be started
to pick up changes in vconsole.conf and set the consoles accordingly.
But wait, this doesn't work anymore: the service is never started at
boot (remember f76d2aa6), so switch-to-configuration.pl will not restart
it. Fortunately it can be repaired: here I install a new unit which
does *nothing* on start, but restarts the real service when reloaded.
This perfectly reproduces the original behavior, hopefully without the
original bugs too.

The End?

[1]: cc54211069
[2]: f6ba8671d8 (diff-84849fddcef81458f69725dc18c6614aade5c4f41a032b6908ebcf1ee6740636)
[3]: 8125e8d38e
[4]: https://web.archive.org/web/20180603130107/https://github.com/NixOS/nixpkgs/issues/22470
[5]: https://github.com/NixOS/nixpkgs/issues/81138
[6]: https://web.archive.org/web/20180603130107/https://github.com/NixOS/nixpkgs/issues/22470#issuecomment-330930456
[7]: f76d2aa6e3
[8]: https://github.com/NixOS/nixpkgs/issues/107341
2021-02-21 10:27:34 +01:00
volth
bc0d605cf1 treewide: fix double quoted strings in meta.description
Signed-off-by: Ben Siraphob <bensiraphob@gmail.com>
2021-01-24 19:56:59 +07:00
Florian Klink
88738dd72d
Merge pull request #106787 from flokli/console-optional-display-manager
nixos/console: fix Before= on the systemd-vconsole-setup unit
2021-01-02 11:04:14 +01:00
rnhmjoj
9728907cd3
console: remove console.extraTTYs option
This closes issue #88085
2020-12-17 21:29:33 +01:00
Florian Klink
536988b35e nixos/console: fix Before= on the systemd-vconsole-setup unit
Only set Before=display-manager.service if it is actually present.

On headless systems, `systemctl list-units --state not-found` will
otherwise show display-manager.service.

Reported-In: https://github.com/NixOS/nixpkgs/issues/88597
2020-12-12 21:21:51 +01:00
rnhmjoj
a35b12ed21
nixos/console: set colors using kernel parameters
This commit changes the console colors implementation
to use the kernel parameters instead of relying on terminal
escape sequences. This means the palette is applied by the
kernel itself with no custom code running in the initrd
and works for all virtual terminals (not only tty0).
2019-12-20 00:27:35 +01:00
rnhmjoj
c9276c1b52
nixos: unify virtual console options
This commit moves all the virtual console related options
to a dedicated config/console.nix NixOS module.

Currently most of these are defined in config/i18n.nix
with a "console" prefix like `i18n.consoleFont`,
`i18n.consoleColors` or under `boot` and are implemented
in tasks/kbd.nix.
Since they have little to do with actual internationalisation
and are (informally) in an attrset already, it makes sense to
move them to a specific module.
2019-12-20 00:27:34 +01:00