summary refs log tree commit diff
path: root/nixos/modules/services/ttys
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-04-16 16:10:11 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-04-16 16:11:17 +0200
commitc81565f6cf7e0763d17b8513bc5183b778ae699b (patch)
treed66b1220ef978859d34330ec780f0f6bb4a2fafd /nixos/modules/services/ttys
parentc382ad1e17c3b11374a1c1d72f6623e163d01b11 (diff)
downloadnixlib-c81565f6cf7e0763d17b8513bc5183b778ae699b.tar
nixlib-c81565f6cf7e0763d17b8513bc5183b778ae699b.tar.gz
nixlib-c81565f6cf7e0763d17b8513bc5183b778ae699b.tar.bz2
nixlib-c81565f6cf7e0763d17b8513bc5183b778ae699b.tar.lz
nixlib-c81565f6cf7e0763d17b8513bc5183b778ae699b.tar.xz
nixlib-c81565f6cf7e0763d17b8513bc5183b778ae699b.tar.zst
nixlib-c81565f6cf7e0763d17b8513bc5183b778ae699b.zip
Remove hack for using upstream getty units
Also, enable the container-getty@ unit so that "machinectl login"
works.
Diffstat (limited to 'nixos/modules/services/ttys')
-rw-r--r--nixos/modules/services/ttys/agetty.nix21
1 files changed, 11 insertions, 10 deletions
diff --git a/nixos/modules/services/ttys/agetty.nix b/nixos/modules/services/ttys/agetty.nix
index 442774af2512..c4571ef856f4 100644
--- a/nixos/modules/services/ttys/agetty.nix
+++ b/nixos/modules/services/ttys/agetty.nix
@@ -49,22 +49,23 @@ with lib;
   config = {
 
     systemd.services."getty@" =
-      { baseUnit = pkgs.runCommand "getty.service" {}
-          ''
-            sed '/ExecStart/ d' < ${config.systemd.package}/example/systemd/system/getty@.service > $out
-          '';
-        serviceConfig.ExecStart = "@${pkgs.utillinux}/sbin/agetty agetty --noclear --login-program ${pkgs.shadow}/bin/login %I 38400";
+      { baseUnit = "${config.systemd.package}/example/systemd/system/getty@.service";
+        serviceConfig.ExecStart = "@${pkgs.utillinux}/sbin/agetty agetty --noclear --login-program ${pkgs.shadow}/bin/login --keep-baud %I 115200,38400,9600 $TERM";
         restartIfChanged = false;
       };
 
     systemd.services."serial-getty@" =
-      { baseUnit = pkgs.runCommand "serial-getty.service" {}
-          ''
-            sed '/ExecStart/ d' < ${config.systemd.package}/example/systemd/system/serial-getty@.service > $out
-          '';
+      { baseUnit = "${config.systemd.package}/example/systemd/system/serial-getty@.service";
         serviceConfig.ExecStart =
           let speeds = concatStringsSep "," (map toString config.services.mingetty.serialSpeed);
-          in "@${pkgs.utillinux}/sbin/agetty agetty --login-program ${pkgs.shadow}/bin/login %I ${speeds}";
+          in "@${pkgs.utillinux}/sbin/agetty agetty --login-program ${pkgs.shadow}/bin/login %I ${speeds} $TERM";
+        restartIfChanged = false;
+      };
+
+    systemd.services."container-getty@" =
+      { baseUnit = "${config.systemd.package}/example/systemd/system/container-getty@.service";
+        unitConfig.ConditionPathExists = "/dev/pts/%I"; # Work around being respawned when "machinectl login" exits.
+        serviceConfig.ExecStart = "@${pkgs.utillinux}/sbin/agetty agetty --noclear --login-program ${pkgs.shadow}/bin/login --keep-baud pts/%I 115200,38400,9600 $TERM";
         restartIfChanged = false;
       };