Merge pull request #47538 from xaverdh/kmscon-autologin
nixos/kmscon: Add autologin option
This commit is contained in:
commit
a179d44bd1
@ -4,6 +4,8 @@ let
|
|||||||
|
|
||||||
cfg = config.services.kmscon;
|
cfg = config.services.kmscon;
|
||||||
|
|
||||||
|
autologinArg = lib.optionalString (cfg.autologinUser != null) "-f ${cfg.autologinUser}";
|
||||||
|
|
||||||
configDir = pkgs.writeTextFile { name = "kmscon-config"; destination = "/kmscon.conf"; text = cfg.extraConfig; };
|
configDir = pkgs.writeTextFile { name = "kmscon-config"; destination = "/kmscon.conf"; text = cfg.extraConfig; };
|
||||||
in {
|
in {
|
||||||
options = {
|
options = {
|
||||||
@ -39,6 +41,15 @@ in {
|
|||||||
default = "";
|
default = "";
|
||||||
example = "--term xterm-256color";
|
example = "--term xterm-256color";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
autologinUser = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
Username of the account that will be automatically logged in at the console.
|
||||||
|
If unspecified, a login prompt is shown as usual.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -61,7 +72,7 @@ in {
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=
|
ExecStart=
|
||||||
ExecStart=${pkgs.kmscon}/bin/kmscon "--vt=%I" ${cfg.extraOptions} --seats=seat0 --no-switchvt --configdir ${configDir} --login -- ${pkgs.shadow}/bin/login -p
|
ExecStart=${pkgs.kmscon}/bin/kmscon "--vt=%I" ${cfg.extraOptions} --seats=seat0 --no-switchvt --configdir ${configDir} --login -- ${pkgs.shadow}/bin/login -p ${autologinArg}
|
||||||
UtmpIdentifier=%I
|
UtmpIdentifier=%I
|
||||||
TTYPath=/dev/%I
|
TTYPath=/dev/%I
|
||||||
TTYReset=yes
|
TTYReset=yes
|
||||||
|
Loading…
Reference in New Issue
Block a user