summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorCharles Strahan <charles.c.strahan@gmail.com>2015-07-04 18:45:36 -0400
committerCharles Strahan <charles@cstrahan.com>2017-01-21 18:59:28 -0500
commit71f92bc8a386bcd05f74d56113fd2f408145ad7e (patch)
tree7ea9a9bacdcd823ed5a246801ee478fa697928e0 /nixos
parent737de61912fbf4e654819c3c39786ac5bffa3048 (diff)
downloadnixpkgs-71f92bc8a386bcd05f74d56113fd2f408145ad7e.tar
nixpkgs-71f92bc8a386bcd05f74d56113fd2f408145ad7e.tar.gz
nixpkgs-71f92bc8a386bcd05f74d56113fd2f408145ad7e.tar.bz2
nixpkgs-71f92bc8a386bcd05f74d56113fd2f408145ad7e.tar.lz
nixpkgs-71f92bc8a386bcd05f74d56113fd2f408145ad7e.tar.xz
nixpkgs-71f92bc8a386bcd05f74d56113fd2f408145ad7e.tar.zst
nixpkgs-71f92bc8a386bcd05f74d56113fd2f408145ad7e.zip
nixos: provide default console_cmd for slim
This provides a default console_cmd for the slim display-manager.

When the user enters "console" as the user name, slim will run this
command.

Having a default is rather important; the virtual terminals don't work
with some display drivers, so having a broken X session can leave you
locked out of your machine.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/x11/display-managers/slim.nix13
1 files changed, 13 insertions, 0 deletions
diff --git a/nixos/modules/services/x11/display-managers/slim.nix b/nixos/modules/services/x11/display-managers/slim.nix
index c7fbfa85e33..1cef242dae6 100644
--- a/nixos/modules/services/x11/display-managers/slim.nix
+++ b/nixos/modules/services/x11/display-managers/slim.nix
@@ -19,6 +19,7 @@ let
       reboot_cmd ${config.systemd.package}/sbin/shutdown -r now
       ${optionalString (cfg.defaultUser != null) ("default_user " + cfg.defaultUser)}
       ${optionalString cfg.autoLogin "auto_login yes"}
+      ${optionalString (cfg.consoleCmd != null) "console_cmd ${cfg.consoleCmd}"}
       ${cfg.extraConfig}
     '';
 
@@ -99,6 +100,18 @@ in
         '';
       };
 
+      consoleCmd = mkOption {
+        type = types.nullOr types.str;
+        default = ''
+          ${pkgs.xterm}/bin/xterm -C -fg white -bg black +sb -T "Console login" -e ${pkgs.shadow}/bin/login
+        '';
+        defaultText = ''
+          ''${pkgs.xterm}/bin/xterm -C -fg white -bg black +sb -T "Console login" -e ''${pkgs.shadow}/bin/login
+        '';
+        description = ''
+          The command to run when "console" is given as the username.
+        '';
+      };
     };
 
   };