Using X without a Display Manager: Difference between revisions

From NixOS Wiki
imported>Fadenb
m Syntaxhighlight
imported>Fadenb
m →‎Use xlaunch: whitespace removal
Line 12: Line 12:


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
  environment.systemPackages = with pkgs; [
environment.systemPackages = with pkgs; [
    xlaunch
  xlaunch
  ];
];


  security.setuidPrograms = [
security.setuidPrograms = [
    "xlaunch"
  "xlaunch"
  ];
];


  services.xserver = {
services.xserver = {
    autorun = false;
  autorun = false;
    enable = true;
  enable = true;
    enableTCP = false;
  enableTCP = false;
    exportConfiguration = true;
  exportConfiguration = true;
    layout = "us";
  layout = "us";
    desktopManager = {
  desktopManager = {
      xterm.enable = false;
    xterm.enable = false;
      xfce.enable = false;
    xfce.enable = false;
    };
    # XXX: slim must not be disabled for xlaunch to work
#    displayManager = {
#      slim.enable = false;
#      job.execCmd = "";
#    };
    windowManager = {
      fluxbox.enable = true;
    };
   };
   };
 
  # XXX: slim must not be disabled for xlaunch to work
  # displayManager = {
  #  slim.enable = false;
  #  job.execCmd = "";
  # };
  windowManager = {
    fluxbox.enable = true;
  };
};
</syntaxhighlight>
</syntaxhighlight>



Revision as of 12:38, 27 August 2017

X without a Display Manager is unsupported

Many people (especially coming from Arch Linux) are used to starting X manually, e.g. with `startx`. In NixOS, this is currently unsupported.

The reason that it is unsupported is that the upstreams (Xorg and systemd) by default do not support this functionality. Arch Linux has special hacks in place to make it work at all.

If you really care about this feature, you are welcome to port these hacks to NixOS - there is no philosophical objection to having manual startx working. However, to date no one in the community has cared enough to get it working.

Use xlaunch

Warning: Several users on IRC have reported that this no longer works on unstable. (2015/07)

1. Edit configuration.nix appropriately - the following has relevant bits for fluxbox:

environment.systemPackages = with pkgs; [
  xlaunch
];

security.setuidPrograms = [
  "xlaunch"
];

services.xserver = {
  autorun = false;
  enable = true;
  enableTCP = false;
  exportConfiguration = true;
  layout = "us";
  desktopManager = {
    xterm.enable = false;
    xfce.enable = false;
  };
  # XXX: slim must not be disabled for xlaunch to work
  # displayManager = {
  #  slim.enable = false;
  #  job.execCmd = "";
  # };
  windowManager = {
    fluxbox.enable = true;
  };
};

2. nixos-rebuild as usual:

# nixos-rebuild switch

3. Possibly reboot

4. Start xlaunch from command line, e.g. for fluxbox:

$ xlaunch startfluxbox