From d809a9e6b2e7cc249fe6134065ba8d119a69c73c Mon Sep 17 00:00:00 2001 From: aszlig Date: Sun, 12 Aug 2012 07:15:56 +0200 Subject: [PATCH] mingetty: Option to not restart on service change. This especially annoyed me whenver I was doing nixos-rebuild switch and getting logged out on all consoles. With this there now is services.mingetty.dontRestart for heavy VT users to deactivate this behaviour. --- modules/services/ttys/mingetty.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/services/ttys/mingetty.nix b/modules/services/ttys/mingetty.nix index e5dbc07aeb0f..23cdf861d168 100644 --- a/modules/services/ttys/mingetty.nix +++ b/modules/services/ttys/mingetty.nix @@ -46,6 +46,14 @@ with pkgs.lib; ''; }; + dontRestart = mkOption { + default = false; + description = '' + Don't restart mingetty processes as this will result in active + sessions to be logged out, for example on activation of the system's + configuration. + ''; + }; }; }; @@ -69,6 +77,8 @@ with pkgs.lib; exec = "mingetty --loginprog=${pkgs.shadow}/bin/login --noclear ${tty}"; + restartIfChanged = !config.services.mingetty.dontRestart; + environment.LOCALE_ARCHIVE = "/run/current-system/sw/lib/locale/locale-archive"; }) config.services.mingetty.ttys);