Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos: provide default console_cmd for slim #8642

Merged
merged 1 commit into from Jan 22, 2017

Conversation

cstrahan
Copy link
Contributor

@cstrahan cstrahan commented Jul 4, 2015

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.

@cstrahan
Copy link
Contributor Author

cstrahan commented Jul 4, 2015

So, question: should we pass -p to login, so env vars like DISPLAY remain available? I don't know if that would cause any security problems or not, or cause any other conflicts.

@cstrahan
Copy link
Contributor Author

cstrahan commented Jul 4, 2015

/cc @lethalman, since you seem to be pretty knowledgeable in this area. (That, and you helped me out with precisely the problem I'm trying to help others avoid.)

@jagajaga
Copy link
Member

jagajaga commented Jul 5, 2015

That's super awesome and useful! Thank you 🍻
I 👍

@cstrahan
Copy link
Contributor Author

cstrahan commented Jul 5, 2015

I think an alternative to using login -p to preserve DISPLAY would be to add this to environment.extraInit:

export DISPLAY="$(systemctl --user show-environment | ${pkgs.gnused}/bin/sed 's/^DISPLAY=\(.*\)/\1/; t; d')"

(cribbed from nixos/modules/programs/ssh.nix)

... but I'm not sure. I don't have much experience in this particular area, so I'd certainly appreciate it if someone else would chime in. All examples I've seen online use /bin/login instead of /bin/login -p, and even the docs for login suggest -p is specifically "Used by getty(8) to tell login not to destroy the environment." So I'm hesitant to use -p.

I suppose we could just punt on it for now, though. I would think it would be ideal, however, if one wouldn't need to guess at the correct DISPLAY variable.

@rasendubi
Copy link
Member

(triage) status?

@joachifm
Copy link
Contributor

@cstrahan is there anything that remains to be done before integrating this?

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.
@cstrahan
Copy link
Contributor Author

Should be fine; merging.

@cstrahan cstrahan merged commit 5b1b089 into NixOS:master Jan 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants