nixos/console: move enable option out of let in
This commit is contained in:
committed by
Sandro Jäckel
parent
a832695c57
commit
5f03b6ddfc
@@ -34,14 +34,16 @@ let
|
|||||||
"/share/unimaps"
|
"/share/unimaps"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
setVconsole = !config.boot.isContainer;
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
###### interface
|
###### interface
|
||||||
|
|
||||||
options.console = {
|
options.console = {
|
||||||
|
enable = mkEnableOption (lib.mdDoc "virtual console") // {
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
|
||||||
font = mkOption {
|
font = mkOption {
|
||||||
type = with types; either str path;
|
type = with types; either str path;
|
||||||
default = "Lat2-Terminus16";
|
default = "Lat2-Terminus16";
|
||||||
@@ -125,11 +127,17 @@ in
|
|||||||
'');
|
'');
|
||||||
}
|
}
|
||||||
|
|
||||||
(mkIf (!setVconsole) {
|
(mkIf (!cfg.enable) {
|
||||||
systemd.services.systemd-vconsole-setup.enable = false;
|
systemd.services = {
|
||||||
|
"serial-getty@ttyS0".enable = false;
|
||||||
|
"serial-getty@hvc0".enable = false;
|
||||||
|
"getty@tty1".enable = false;
|
||||||
|
"autovt@".enable = false;
|
||||||
|
systemd-vconsole-setup.enable = false;
|
||||||
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf setVconsole (mkMerge [
|
(mkIf cfg.enable (mkMerge [
|
||||||
{ environment.systemPackages = [ pkgs.kbd ];
|
{ environment.systemPackages = [ pkgs.kbd ];
|
||||||
|
|
||||||
# Let systemd-vconsole-setup.service do the work of setting up the
|
# Let systemd-vconsole-setup.service do the work of setting up the
|
||||||
|
|||||||
@@ -7,8 +7,11 @@ with lib;
|
|||||||
config = mkIf config.boot.isContainer {
|
config = mkIf config.boot.isContainer {
|
||||||
|
|
||||||
# Disable some features that are not useful in a container.
|
# Disable some features that are not useful in a container.
|
||||||
|
|
||||||
boot.kernel.enable = false;
|
boot.kernel.enable = false;
|
||||||
|
|
||||||
|
console.enable = mkDefault false;
|
||||||
|
|
||||||
nix.optimise.automatic = mkDefault false; # the store is host managed
|
nix.optimise.automatic = mkDefault false; # the store is host managed
|
||||||
powerManagement.enable = mkDefault false;
|
powerManagement.enable = mkDefault false;
|
||||||
documentation.nixos.enable = mkDefault false;
|
documentation.nixos.enable = mkDefault false;
|
||||||
|
|||||||
Reference in New Issue
Block a user