summary refs log tree commit diff
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2016-07-03 03:29:21 +0300
committerNikolay Amiantov <ab@fmap.me>2016-07-08 12:52:39 +0300
commit6c11d9dd55b7dab91fe54ab17f739df74f9b4b2c (patch)
tree03b2862c1cef428f2c160a3900af11e57b91b57c
parent489bbf0609f3a7fda0bf0ba89b7d7a1dc902e2eb (diff)
downloadnixpkgs-6c11d9dd55b7dab91fe54ab17f739df74f9b4b2c.tar
nixpkgs-6c11d9dd55b7dab91fe54ab17f739df74f9b4b2c.tar.gz
nixpkgs-6c11d9dd55b7dab91fe54ab17f739df74f9b4b2c.tar.bz2
nixpkgs-6c11d9dd55b7dab91fe54ab17f739df74f9b4b2c.tar.lz
nixpkgs-6c11d9dd55b7dab91fe54ab17f739df74f9b4b2c.tar.xz
nixpkgs-6c11d9dd55b7dab91fe54ab17f739df74f9b4b2c.tar.zst
nixpkgs-6c11d9dd55b7dab91fe54ab17f739df74f9b4b2c.zip
kbd service: add system-wise console resources
-rw-r--r--nixos/modules/config/i18n.nix9
-rw-r--r--nixos/modules/tasks/kbd.nix15
2 files changed, 19 insertions, 5 deletions
diff --git a/nixos/modules/config/i18n.nix b/nixos/modules/config/i18n.nix
index b20fac6ad3e..2dc0df85e5f 100644
--- a/nixos/modules/config/i18n.nix
+++ b/nixos/modules/config/i18n.nix
@@ -41,6 +41,15 @@ in
         '';
       };
 
+      consolePackages = mkOption {
+        type = types.listOf types.package;
+        default = [];
+        description = ''
+	  List of additional packages that provide console fonts, keymaps and
+          other resources.
+        '';
+      };
+
       consoleFont = mkOption {
         type = types.str;
         default = "Lat2-Terminus16";
diff --git a/nixos/modules/tasks/kbd.nix b/nixos/modules/tasks/kbd.nix
index c1087ce4783..dd89804d43a 100644
--- a/nixos/modules/tasks/kbd.nix
+++ b/nixos/modules/tasks/kbd.nix
@@ -13,6 +13,12 @@ let
     ${colors}
   '';
 
+  kbdEnv = pkgs.buildEnv {
+    name = "kbd-env";
+    paths = [ pkgs.kbd ] ++ config.i18n.consolePackages;
+    pathsToLink = [ "/share/consolefonts" "/share/consoletrans" "/share/keymaps" "/share/unimaps" ];
+  };
+
   setVconsole = !config.boot.isContainer;
 in
 
@@ -53,10 +59,9 @@ in
 
       # Let systemd-vconsole-setup.service do the work of setting up the
       # virtual consoles.
-      environment.etc = [ {
-        target = "vconsole.conf";
-        source = vconsoleConf;
-      } ];
+      environment.etc."vconsole.conf".source = vconsoleConf;
+      # Provide kbd with additional packages.
+      environment.etc."kbd".source = "${kbdEnv}/share";
 
       # This is identical to the systemd-vconsole-setup.service unit
       # shipped with systemd, except that it uses /dev/tty1 instead of
@@ -66,7 +71,7 @@ in
         { wantedBy = [ "multi-user.target" ];
           before = [ "display-manager.service" ];
           after = [ "systemd-udev-settle.service" ];
-          restartTriggers = [ vconsoleConf ];
+          restartTriggers = [ vconsoleConf kbdEnv ];
         };
     })
   ];