summary refs log tree commit diff
path: root/nixos/modules/services/ttys
diff options
context:
space:
mode:
authorNaïm Favier <n@monade.li>2021-02-26 13:17:04 +0100
committerNaïm Favier <n@monade.li>2021-02-26 13:17:04 +0100
commit302fcc4674803169af9efdb247fd529e65853459 (patch)
tree16b92ca44962faded7242a956a9368f64832ac11 /nixos/modules/services/ttys
parentc6f1dc2320db5b28136ca4a78ffce5cf0b7cdba5 (diff)
downloadnixpkgs-302fcc4674803169af9efdb247fd529e65853459.tar
nixpkgs-302fcc4674803169af9efdb247fd529e65853459.tar.gz
nixpkgs-302fcc4674803169af9efdb247fd529e65853459.tar.bz2
nixpkgs-302fcc4674803169af9efdb247fd529e65853459.tar.lz
nixpkgs-302fcc4674803169af9efdb247fd529e65853459.tar.xz
nixpkgs-302fcc4674803169af9efdb247fd529e65853459.tar.zst
nixpkgs-302fcc4674803169af9efdb247fd529e65853459.zip
nixos/getty: add services.getty.extraArgs
Diffstat (limited to 'nixos/modules/services/ttys')
-rw-r--r--nixos/modules/services/ttys/getty.nix20
1 files changed, 14 insertions, 6 deletions
diff --git a/nixos/modules/services/ttys/getty.nix b/nixos/modules/services/ttys/getty.nix
index ecfabef5fb1..2480e681de8 100644
--- a/nixos/modules/services/ttys/getty.nix
+++ b/nixos/modules/services/ttys/getty.nix
@@ -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
 
@@ -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 {