I’m new to Nix and can’t figure out how I am supposed to configure remote logins, sessions… through RDP for Gnome (already used this in Arch before). I assumed I would just be able to add this to my existing config:
What’s the correct way of setting this up. I just want to use gnome-remote-desktop to log in remotely with a username and password on a LAN for now. That’s it. Nothing fancy.
I have a spare machine with a broken screen and I could access it with the following configuration:
# Remote desktop
services.xrdp.enable = true;
services.xrdp.defaultWindowManager = "${pkgs.gnome.gnome-session}/bin/gnome-session";
services.xrdp.openFirewall = true;
# Disable the GNOME3/GDM auto-suspend feature that cannot be disabled in GUI!
# If no user is logged in, the machine will power down after 20 minutes.
systemd.targets.sleep.enable = false;
systemd.targets.suspend.enable = false;
systemd.targets.hibernate.enable = false;
systemd.targets.hybrid-sleep.enable = false;
Without the second part, the machine was auto-suspending even though I was remotely connected. I could be remembering wrong, though, as it`s been a while since I last used this.
Thanks both for replying. Not sure if it changes things but I’m using the newest stable version of gnome with gdm and wayland + I do have a working screen but I also want to go remote some times. What finally ended up working for me was this (found a guide for Fedora on the same issue):
environment.systemPackages = with pkgs; [
pkgs.gnome.gnome-remote-desktop
];
services.gnome.gnome-remote-desktop.enable = true; #(would not want to work without this)
Hi there! Can you post a more complete version of your nix file? I ripped out most of what I had like in your first post and replaced it with what you have in this comment, but now I get this. Maybe there’s some assumptions being made that aren’t fully typed out? I’m running 23.11. Even the gnome-remote-desktop binary doesn’t exist in my path.
# sudo systemctl restart gnome-remote-desktop.service
Failed to restart gnome-remote-desktop.service: Unit gnome-remote-desktop.service not found.
updating this thread here as I had some trouble following all the advice from the comments above; I went down a few rabbit holes of polkits and the gdrp etc.
I will post my configuration below and want to confirm that you will want to ensure that you are not logged into the account on the remote machine.
I have not tested it with multiple user accounts and I may not need all that is detailed here.
This is working for my installation which went on this morning as I have been diving into testing fresh install paths.
# near the top of the section.
# Enable the GNOME Desktop Environment.
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
services.xserver.displayManager.gdm.autoSuspend = false;
services.displayManager.autoLogin.enable = false;
services.gnome.gnome-remote-desktop.enable = true;
services.xrdp.enable = true;
services.xrdp.defaultWindowManager = "gnome-session";
#this allowed me to shut the lid on a dell latitude 5540
services.logind.lidSwitch = "ignore";
# this stops the machine trying to sleep ..
systemd.sleep.extraConfig = ''
AllowSuspend=no
AllowHibernation=no
AllowHybridSleep=no
AllowSuspendThenHibernate=no
'';
##later on in the configuration.nix file
# List packages installed in system profile. To search, run:
environment.systemPackages = with pkgs; [
gnome-session
gnome-remote-desktop
xrdp
];
Ive given this the test of the reboot and now added some packages to my user account section in the config file. This looks to be the answer ; for now.