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

Conversation

@xeji
Copy link
Contributor

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.

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

This comment has been minimized.

Copy link
Contributor Author

commented Oct 3, 2018

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

displayManager.lightdm.enable = lib.mkForce false;
};
systemd.services.display-manager.enable = false;
environment.systemPackages = with pkgs; [ xorg.xinit ];

This comment has been minimized.

Copy link
@Mic92

Mic92 Oct 3, 2018

Contributor

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

@oxij

This comment has been minimized.

Copy link
Contributor

commented Oct 4, 2018

@xeji

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Contributor

commented Oct 5, 2018

@xeji xeji merged commit af6e246 into NixOS:master Oct 10, 2018

8 checks passed

grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-nixos-manual nix-instantiate ./nixos/release.nix -A manual
Details
grahamcofborg-eval-nixos-options nix-instantiate ./nixos/release.nix -A options
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate ./pkgs/top-level/release.nix -A manual
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate ./pkgs/top-level/release.nix -A tarball
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate ./pkgs/top-level/release.nix -A unstable
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details

@xeji xeji deleted the xeji:p/dm-startx branch Oct 10, 2018

@shazow

This comment has been minimized.

Copy link
Contributor

commented Jan 1, 2019

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

@xeji

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Contributor

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
Projects
None yet
5 participants
You can’t perform that action at this time.