summary refs log tree commit diff
path: root/nixos/modules/config
diff options
context:
space:
mode:
authorJanne Heß <janne@hess.ooo>2022-04-24 21:38:16 +0100
committerJanne Heß <janne@hess.ooo>2022-04-30 11:22:08 +0200
commit18363cad97e994b5c30c8271e7cffef0fe1c82a1 (patch)
treee7ac6580a3706254120539e3ab783190be777127 /nixos/modules/config
parentf678ad7c7a306f5a073fbb68e93a074ca2d1f054 (diff)
downloadnixpkgs-18363cad97e994b5c30c8271e7cffef0fe1c82a1.tar
nixpkgs-18363cad97e994b5c30c8271e7cffef0fe1c82a1.tar.gz
nixpkgs-18363cad97e994b5c30c8271e7cffef0fe1c82a1.tar.bz2
nixpkgs-18363cad97e994b5c30c8271e7cffef0fe1c82a1.tar.lz
nixpkgs-18363cad97e994b5c30c8271e7cffef0fe1c82a1.tar.xz
nixpkgs-18363cad97e994b5c30c8271e7cffef0fe1c82a1.tar.zst
nixpkgs-18363cad97e994b5c30c8271e7cffef0fe1c82a1.zip
nixos/console: Allow setting keymap without font
Diffstat (limited to 'nixos/modules/config')
-rw-r--r--nixos/modules/config/console.nix11
1 files changed, 5 insertions, 6 deletions
diff --git a/nixos/modules/config/console.nix b/nixos/modules/config/console.nix
index 5b07901f990..69101bca3f2 100644
--- a/nixos/modules/config/console.nix
+++ b/nixos/modules/config/console.nix
@@ -149,8 +149,11 @@ in
         '');
 
         boot.initrd.systemd.contents = {
-          "/etc/kbd".source = "${consoleEnv config.boot.initrd.systemd.package.kbd}/share";
           "/etc/vconsole.conf".source = vconsoleConf;
+          # Add everything if we want full console setup...
+          "/etc/kbd" = lib.mkIf cfg.earlySetup { source = "${consoleEnv config.boot.initrd.systemd.package.kbd}/share"; };
+          # ...but only the keymaps if we don't
+          "/etc/kbd/keymaps" = lib.mkIf (!cfg.earlySetup) { source = "${consoleEnv config.boot.initrd.systemd.package.kbd}/share/keymaps"; };
         };
         boot.initrd.systemd.storePaths = [
           "${config.boot.initrd.systemd.package}/lib/systemd/systemd-vconsole-setup"
@@ -180,7 +183,7 @@ in
         ];
       })
 
-      (mkIf cfg.earlySetup {
+      (mkIf (cfg.earlySetup && !config.boot.inird.systemd.enable) {
         boot.initrd.extraUtilsCommands = ''
           mkdir -p $out/share/consolefonts
           ${if substring 0 1 cfg.font == "/" then ''
@@ -194,10 +197,6 @@ in
             cp -L $font $out/share/consolefonts/font.psf
           fi
         '';
-        assertions = [{
-          assertion = !config.boot.initrd.systemd.enable;
-          message = "console.earlySetup is implied by systemd stage 1";
-        }];
       })
     ]))
   ];