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/display-managers/startx: init #47773

Merged
merged 1 commit into from
Oct 10, 2018
Merged

nixos/display-managers/startx: init #47773

merged 1 commit into from
Oct 10, 2018

Conversation

xeji
Copy link
Contributor

@xeji xeji commented Oct 3, 2018

Motivation for this change

This defines the startx dummy display manager that allows running X as a normal user.
The X server is started manually from a VT using startx. It is possible to start multiple X sessions from different VTs.

Session startup commands must be provided by the user in ~/.xinitrc, which is NOT automatically generated. This lack of integration with the desktopManager and windowManager settings and other NixOS options is intentional, to keep it simple and give users full control over their X session, independent of system-wide settings.

Here's how I use it with my minimal dwm desktop:

  services.xserver = {
    enable = true;
    displayManager.startx.enable = true;
    desktopManager.default = "none";
    desktopManager.xterm.enable = false;
    windowManager.dwm.enable = true;  # as a convenient way to install the dwm package
  };

A minimal ~/.xinitrc without any extra initialisations may look like:

exec dwm
Things done
  • writing this on a NixOS system using it.

Dummy display manager that allows running X as a normal user.
The X server is started manually from a vt using `startx`.
Session startup commands must be provided by the user
in ~/.xinitrc, which is NOT automatically generated.
@xeji
Copy link
Contributor Author

xeji commented Oct 3, 2018

Combining this with pam-autologin would be a lightweight alternative to our current auto display manager. cc @oxij

@GrahamcOfBorg GrahamcOfBorg added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 0 This PR does not cause any packages to rebuild labels Oct 3, 2018
displayManager.lightdm.enable = lib.mkForce false;
};
systemd.services.display-manager.enable = false;
environment.systemPackages = with pkgs; [ xorg.xinit ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

orthogonal to this pr it would be nice to have something similar for wayland based sessions.

@oxij
Copy link
Member

oxij commented Oct 4, 2018 via email

@xeji
Copy link
Contributor Author

xeji commented Oct 4, 2018

Will reusing .xsession script just work, can I just put exec .xsession in .xinitrc?

Yes. On my system I use home-manager to generate .xsession and do that.

Why displayManager.lightdm.enable = lib.mkForce false;?

lightdm is enabled by default here. I don't like the logic above that line as it's non-modular and don't want to add another display manager to it. That's why I chose mkForce. The default mechanism needs refactoring, but let's leave that for another PR.

@oxij
Copy link
Member

oxij commented Oct 5, 2018 via email

@xeji xeji merged commit af6e246 into NixOS:master Oct 10, 2018
@xeji xeji deleted the p/dm-startx branch October 10, 2018 21:07
@shazow
Copy link
Contributor

shazow commented Jan 1, 2019

If I'm not mistaken, one issue with this solution that xserver.dpi gets ignored?

@xeji
Copy link
Contributor Author

xeji commented Jan 1, 2019

If I'm not mistaken, one issue with this solution that xserver.dpi gets ignored?

Yes. You can pass X server options manually to startx: startx -- -dpi 100. The global options are intentonally ignored to give each user control over how they want to run the X server. That's why I call it a dummy display manager.

@shazow
Copy link
Contributor

shazow commented Jan 1, 2019

@xeji Got it, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 0 This PR does not cause any packages to rebuild
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants