Skip to content

Commit

Permalink
Merge pull request #114465 from ncfavier/master
Browse files Browse the repository at this point in the history
nixos/getty: add services.getty.extraArgs
  • Loading branch information
SuperSandro2000 committed Apr 13, 2021
2 parents c7695f9 + 302fcc4 commit f440f9b
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions nixos/modules/services/ttys/getty.nix
Expand Up @@ -5,17 +5,16 @@ with lib;
let
cfg = config.services.getty;

loginArgs = [
baseArgs = [
"--login-program" "${pkgs.shadow}/bin/login"
] ++ optionals (cfg.autologinUser != null) [
"--autologin" cfg.autologinUser
] ++ optionals (cfg.loginOptions != null) [
"--login-options" cfg.loginOptions
];
] ++ cfg.extraArgs;

gettyCmd = extraArgs:
"@${pkgs.util-linux}/sbin/agetty agetty ${escapeShellArgs loginArgs} "
+ extraArgs;
gettyCmd = args:
"@${pkgs.util-linux}/sbin/agetty agetty ${escapeShellArgs baseArgs} ${args}";

in

Expand Down Expand Up @@ -54,7 +53,16 @@ in
will not be invoked with a <option>--login-options</option>
option.
'';
example = "-h darkstar -- \u";
example = "-h darkstar -- \\u";
};

extraArgs = mkOption {
type = types.listOf types.str;
default = [ ];
description = ''
Additional arguments passed to agetty.
'';
example = [ "--nohostname" ];
};

greetingLine = mkOption {
Expand Down

0 comments on commit f440f9b

Please sign in to comment.