Hi All, I thought I would share something to help you if you are struggling in getting the GDM login screen to not show on the correct monitor if you have multi monitor setup. you have to first create a monitor.xml file in your /home/username/.config/ folder or this is automatically done and setup when you login with gnome and you set your monitor layout how you want there. Once done. Add the below to your configuration.nix file. Note the areas where you have to change the directory names to your user name first.
for most this should be it, however I had to do a reboot for it to show.
if still having issues follow the below…
Ensure Permissions: Make sure the GDM user has the necessary permissions to read the monitors.xml file. You can do this by running the following commands:
Manually Copy the monitors.xml File: As a temporary measure, manually copy the monitors.xml file to the GDM configuration directory to see if it resolves the issue. Run the following commands:
I think this no longer works with Gnome 49. At least for me
Edit: Nope, it still works. My issue was with my specific setup.
The path had changed with 49 from /run/gdm/.config/monitors.xml to /var/lib/gdm/seat0/config/monitors.xml, which is easy to adapt.
My issue was that I had used L instead of L+ in my setup using systemd tmpfiles:
systemd.tmpfiles.rules =
let
monitors.xml = pkgs.writeText "monitors.xml" ''
(...) # (my copy-pasted monitors.xml from $HOME/.config/monitors.xml)
'';
in
"L /var/lib/gdm/seat0/config/monitors.xml - gdm gdm - ${monitors.xml}"
];
L creates a symlink, L+ overwrites if necessary. A simple change to L+ fixed my issue. Kinda obvious in hindsight. Not sure why the old symlink got borked, but it did. This should prevent similar issues in the future.