NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.93k stars 13.95k forks source link

xrandrHeads doesnt seem to work (maybe nvidia related) #72250

Open gallexme opened 4 years ago

gallexme commented 4 years ago

Describe the bug xrandrheads settings are beeing ignored by xserver

To Reproduce on a nvidia system(not sure if others are affected)

services.xserver.xrandrHeads = [ 
    {
      output = "DP-2";
      primary = true;
    }
    {
      output="DP-4"; 
      monitorConfig =
    ''
            Option "LeftOf" "DP-2"
    '';
    }
  ];

Expected behavior dp-2 should be primary and dp-4 should be left of dp-2

Additional context generated x config

Section "Files"

  FontPath "/nix/store/jlqzanp3y82apzj2hlx04vhvfb2ka85y-font-bh-lucidatypewriter-100dpi-1.0.3/lib/X11/fonts/100dpi"
  FontPath "/nix/store/g5g7vc7pnpd5f009cmaggw4miv6xa40p-font-bh-lucidatypewriter-75dpi-1.0.3/lib/X11/fonts/75dpi"
  FontPath "/nix/store/mirimzji3bx5d6vnb1swc3idskpjppy3-font-bh-100dpi-1.0.3/lib/X11/fonts/100dpi"
  FontPath "/nix/store/l4jj0r83pp1393z5x6wbh1w6cf64s6zi-font-misc-misc-1.1.2/lib/X11/fonts/misc"
  FontPath "/nix/store/3ph76wlhgk2s0jj5h04qz40j77xqfddp-font-cursor-misc-1.0.3/lib/X11/fonts/misc"
  FontPath "/nix/store/nyx1r5a0vnw0s84p8nh1mqcln89rm3rl-unifont-12.1.03/share/fonts"
  FontPath "/nix/store/lw67xrwapl1680nv9wj2ysj8fx2mkf09-font-adobe-100dpi-1.0.3/lib/X11/fonts/100dpi"
  FontPath "/nix/store/7zg55myfgbm5c2ibbf8ah5jgpj27zvbk-font-adobe-75dpi-1.0.3/lib/X11/fonts/75dpi"
  ModulePath "/nix/store/n83jcxg0ywvwf6mvjcnl8vzh524qlsdk-nvidia-x11-435.21-4.19.80-bin/lib/xorg/modules/extensions"
  ModulePath "/nix/store/n83jcxg0ywvwf6mvjcnl8vzh524qlsdk-nvidia-x11-435.21-4.19.80-bin/lib/xorg/modules/drivers"
  ModulePath "/nix/store/lqmp6hz15a4ahc419fl23f6y6als06ln-xorg-server-1.20.5/lib/xorg/modules"
  ModulePath "/nix/store/lqmp6hz15a4ahc419fl23f6y6als06ln-xorg-server-1.20.5/lib/xorg/modules/extensions"
  ModulePath "/nix/store/lqmp6hz15a4ahc419fl23f6y6als06ln-xorg-server-1.20.5/lib/xorg/modules/drivers"
  ModulePath "/nix/store/wsg47c85z3n59k7lf7ndggz2fv28kiar-xf86-input-evdev-2.10.6/lib/xorg/modules/input"
  ModulePath "/nix/store/9xwxymrmp612m8j2j9n99sj950d6nrpj-xf86-input-libinput-0.28.2/lib/xorg/modules/input"
EndSection
 Section "InputClass"
      Identifier "joystick catchall"
        MatchIsJoystick "on"
          MatchDevicePath "/dev/input/event*"
          # MatchDevicePath "/dev/input/js*"
        #Driver "joystick"
    Driver "evdev"
        Option "StartKeysEnabled" "False"
        Option "StartMouseEnabled" "False"
      # Option "MapAxis1" "deadzone=4000"
      # Option "MapAxis2" "deadzone=4000"
 EndSection

Section "ServerFlags"
  Option "AllowMouseOpenFail" "on"
  Option "DontZap" "on"

EndSection

Section "Module"

EndSection

Section "Monitor"
  Identifier "Monitor[0]"

EndSection

# Additional "InputClass" sections

Section "ServerLayout"
  Identifier "Layout[all]"

  # Reference the Screen sections for each driver.  This will
  # cause the X server to try each in turn.
  Screen "Screen-nvidia[0]"

EndSection

# For each supported driver, add a "Device" and "Screen"
# section.

Section "Device"
  Identifier "Device-nvidia[0]"
  Driver "nvidia"

  Option "monitor-DP-4" "multihead1"
  Option "monitor-DP-2" "multihead2"

EndSection

Section "Screen"
  Identifier "Screen-nvidia[0]"
  Device "Device-nvidia[0]"

  Option "RandRRotation" "on"

EndSection

Section "Monitor"
  Identifier "multihead1"

                Option "LeftOf" "DP-2"

EndSection
Section "Monitor"
  Identifier "multihead2"
  Option "Primary" "true"

  Option "RightOf" "multihead1"

EndSection

# Automatically enable the libinput driver for all touchpads.
Section "InputClass"
  Identifier "libinputConfiguration"
  MatchIsTouchpad "on"

  Driver "libinput"
  Option "AccelProfile" "adaptive"

  Option "LeftHanded" "off"
  Option "MiddleEmulation" "on"
  Option "NaturalScrolling" "off"

  Option "ScrollMethod" "twofinger"
  Option "HorizontalScrolling" "on"
  Option "SendEventsMode" "enabled"
  Option "Tapping" "on"
  Option "TappingDragLock" "on"
  Option "DisableWhileTyping" "off"

EndSection

Metadata Please run nix run nixpkgs.nix-info -c nix-info -m and paste the result. nix run nixpkgs.nix-info -c nix-info -m nix: src/libexpr/attr-set.hh:54: void nix::Bindings::pushback(const nix::Attr&): Assertion `size < capacity_' failed. Aborted (core dumped) uhm?? lets just say newest unstable had same issue since 18.03 but ive used gnome/kde in past to set displays there now im using awesomewm/i3 which dont provide such functionality

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:  services.xserver.xrandrHeads
# a list of nixos modules affected by the problem
module: services.xserver
stale[bot] commented 4 years ago

Thank you for your contributions. This has been automatically marked as stale because it has had no activity for 180 days. If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity. Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse. 3. Ask on the #nixos channel on irc.freenode.net.
GGG-KILLER commented 1 year ago

Still an issue in unstable.

zeorin commented 1 year ago

I'm working around this as follows for the time being:

{
  displayManager.setupCommands = "${pkgs.xorg.xrandr}/bin/xrandr --output HDMI-0 --auto --output DP-1 --auto --right-of HDMI-0 --primary";
}

From https://github.com/NixOS/nixpkgs/issues/30796#issuecomment-675866888, which might be the same underlying issue.

JordanPavlic commented 2 months ago

still an issue in unstable - lost 4 hours on this bug before finding this.