Hello everyone,
I’m running NixOS 25.05 (“Warbler”) with Home Manager and Hyprland (Wayland compositor). I have a custom configuration to set up my displays in SDDM with xrandr
commands before login, but unfortunately it does not work as expected.
My problem:
- DP-1 is not rotated in the SDDM login screen: Despite specifying
xrandr --output DP-1 --auto --rotate right
the monitor remains in the default orientation on the SDDM login screen.
- DP-3 is not set as primary: Even though I use
--primary
for DP-3, the login screen sometimes shows another monitor (e.g., laptop internal display) as primary.
Relevant snippet of my SDDM module config:
{ pkgs, lib, ... }:
let
sddmAstronautCustom =
pkgs.sddm-astronaut.override { embeddedTheme = "pixel_sakura"; };
in {
environment.systemPackages = [ sddmAstronautCustom ];
services.displayManager.sddm = {
enable = true;
package = pkgs.kdePackages.sddm;
theme = "sddm-astronaut-theme";
extraPackages = [ sddmAstronautCustom ];
wayland.enable = false; # Using X11 for better monitor control
};
services.xserver.enable = true;
# Monitor configuration for SDDM
services.xserver.displayManager.setupCommands = ''
xrandr --output DP-3 --primary --auto --rotate normal
xrandr --output DP-1 --auto --rotate right
'';
}
My Hyprland configuration (modules/services/hyprland.nix
):
{ pkgs, config, ... }: {
# NixOS Hyprland module (system-wide)
programs.hyprland = {
enable = true;
xwayland.enable = true;
withUWSM = true;
};
programs.uwsm = { enable = true; };
security.pam.services.login.enableGnomeKeyring = true;
# Additional system packages
environment.systemPackages = with pkgs; [ xdg-desktop-portal-hyprland ];
}
Directory tree excerpt of my NixOS config:
.
├── Commands.txt
├── configuration.nix.backup
├── flake.lock
├── flake.nix
├── home
│ └── default.nix
├── hosts
│ ├── desktop
│ │ ├── default.nix
│ │ └── hardware-configuration.nix
│ └── laptop
│ ├── default.nix
│ └── hardware.nix
├── modules
│ ├── hardware
│ │ └── nvidia.nix
│ ├── services
│ │ ├── audio.nix
│ │ ├── bluetooth.nix
│ │ ├── greetd.nix
│ │ ├── hyprland.nix
│ │ └── sddm.nix
│ └── system
│ ├── boot.nix
│ ├── locale.nix
│ ├── neovim.nix
│ ├── networking.nix
│ ├── nix.nix
│ ├── packageslaptoponly.nix
│ ├── packages.nix
│ ├── shell.nix
│ └── users.nix
├── README.md
├── repo.sh
└── users
├── lucas
│ └── home.nix
└── telisti
Questions:
Why are the xrandr commands in services.xserver.displayManager.setupCommands ignored in SDDM on NixOS 25.05?
Could Hyprland (Wayland compositor) or xwayland interactions interfere with the X11 login manager display setup?
Are there known timing, permission, or display manager-specific issues that prevent setupCommands from correctly applying monitor layout?
What workarounds exist to reliably set monitor rotation and primary output in the SDDM login screen with this stack?
Should the monitor setup be triggered elsewhere (e.g. via SDDM scripts or systemd services)?
Thanks very much for any help, hints, or debugging tips!
If needed, I can provide logs or further config snippets.