lol

kbd module: don't setup vconsoles if we are in a container

+27 -18
+27 -18
nixos/modules/tasks/kbd.nix
··· 12 12 FONT=${config.i18n.consoleFont} 13 13 ${colors} 14 14 ''; 15 + 16 + setVconsole = !config.boot.isContainer; 15 17 in 16 18 17 19 { ··· 41 43 42 44 ###### implementation 43 45 44 - config = { 46 + config = mkMerge [ 47 + (mkIf (!setVconsole) { 48 + systemd.services."systemd-vconsole-setup".enable = false; 49 + }) 45 50 46 - environment.systemPackages = [ pkgs.kbd ]; 51 + (mkIf setVconsole { 52 + environment.systemPackages = [ pkgs.kbd ]; 47 53 48 - # Let systemd-vconsole-setup.service do the work of setting up the 49 - # virtual consoles. FIXME: trigger a restart of 50 - # systemd-vconsole-setup.service if /etc/vconsole.conf changes. 51 - environment.etc."vconsole.conf".source = vconsoleConf; 54 + # Let systemd-vconsole-setup.service do the work of setting up the 55 + # virtual consoles. FIXME: trigger a restart of 56 + # systemd-vconsole-setup.service if /etc/vconsole.conf changes. 57 + environment.etc = [ { 58 + target = "vconsole.conf"; 59 + source = vconsoleConf; 60 + } ]; 52 61 53 - # This is identical to the systemd-vconsole-setup.service unit 54 - # shipped with systemd, except that it uses /dev/tty1 instead of 55 - # /dev/tty0 to prevent putting the X server in non-raw mode, and 56 - # it has a restart trigger. 57 - systemd.services."systemd-vconsole-setup" = 58 - { wantedBy = [ "multi-user.target" ]; 59 - before = [ "display-manager.service" ]; 60 - after = [ "systemd-udev-settle.service" ]; 61 - restartTriggers = [ vconsoleConf ]; 62 - }; 63 - 64 - }; 62 + # This is identical to the systemd-vconsole-setup.service unit 63 + # shipped with systemd, except that it uses /dev/tty1 instead of 64 + # /dev/tty0 to prevent putting the X server in non-raw mode, and 65 + # it has a restart trigger. 66 + systemd.services."systemd-vconsole-setup" = 67 + { wantedBy = [ "multi-user.target" ]; 68 + before = [ "display-manager.service" ]; 69 + after = [ "systemd-udev-settle.service" ]; 70 + restartTriggers = [ vconsoleConf ]; 71 + }; 72 + }) 73 + ]; 65 74 66 75 }