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.
This commit is contained in:
Charles Strahan 2015-07-04 18:45:36 -04:00 committed by Charles Strahan
parent 737de61912
commit 71f92bc8a3
No known key found for this signature in database
GPG key ID: BB47AB4B8489B5A5

View file

@ -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.
'';
};
};
};