3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/nixos/modules/tasks/kbd.nix
Eelco Dolstra 179acfb664 Allow upstream systemd units to be extended
If you define a unit, and either systemd or a package in
systemd.packages already provides that unit, then we now generate a
file /etc/systemd/system/<unit>.d/overrides.conf. This makes it
possible to use upstream units, while allowing them to be customised
from the NixOS configuration. For instance, the module nix-daemon.nix
now uses the units provided by the Nix package. And all unit
definitions that duplicated upstream systemd units are finally gone.

This makes the baseUnit option unnecessary, so I've removed it.
2014-04-17 18:52:31 +02:00

62 lines
1.5 KiB
Nix

{ config, lib, pkgs, ... }:
with lib;
let
vconsoleConf = pkgs.writeText "vconsole.conf"
''
KEYMAP=${config.i18n.consoleKeyMap}
FONT=${config.i18n.consoleFont}
'';
in
{
###### interface
options = {
# most options are defined in i18n.nix
# FIXME: still needed?
boot.extraTTYs = mkOption {
default = [];
example = ["tty8" "tty9"];
description = ''
Tty (virtual console) devices, in addition to the consoles on
which mingetty and syslogd run, that must be initialised.
Only useful if you have some program that you want to run on
some fixed console. For example, the NixOS installation CD
opens the manual in a web browser on console 7, so it sets
<option>boot.extraTTYs</option> to <literal>["tty7"]</literal>.
'';
};
};
###### implementation
config = {
environment.systemPackages = [ pkgs.kbd ];
# Let systemd-vconsole-setup.service do the work of setting up the
# virtual consoles. FIXME: trigger a restart of
# systemd-vconsole-setup.service if /etc/vconsole.conf changes.
environment.etc."vconsole.conf".source = vconsoleConf;
# This is identical to the systemd-vconsole-setup.service unit
# shipped with systemd, except that it uses /dev/tty1 instead of
# /dev/tty0 to prevent putting the X server in non-raw mode, and
# it has a restart trigger.
systemd.services."systemd-vconsole-setup" =
{ wantedBy = [ "multi-user.target" ];
restartTriggers = [ vconsoleConf ];
};
};
}