Repository navigation
amd: KRdp remote desktop, declaratively (package + user service) #699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| { pkgs, ... }: | ||
| { | ||
| # KRdp -- KDE's native RDP server -- for the amd laptop only. | ||
| # | ||
| # This is the declarative counterpart to the imperative RustDesk setup: | ||
| # RustDesk is the interim remote desktop, KRdp is the one that survives | ||
| # rebuilds because it lives here. nixpkgs (pinned) has no NixOS or | ||
| # home-manager module for KRdp -- kdePackages.krdp is only an optional | ||
| # package of the Plasma 6 desktop module -- so the package and its user | ||
| # service are wired by hand below, for user "user" only, via this | ||
| # amd-only host module (see nixos/hosts/default.nix). | ||
| # | ||
| # The unit deliberately reuses the name and contents of the unit the | ||
| # krdp package itself ships (share/systemd/user/app-org.kde.krdpserver | ||
| # .service, preset-disabled upstream): the Remote Desktop page in System | ||
| # Settings starts/stops/enables exactly this unit over D-Bus, so the | ||
| # settings toggle and this declaration manage one and the same service | ||
| # instead of fighting. WantedBy plasma-workspace.target means it starts | ||
| # with the Plasma session and simply never runs in a non-Plasma one. | ||
| # | ||
| # No secrets in this repo, by design: | ||
| # - RDP usernames/passwords are NOT passed on the command line (they | ||
| # would land in the world-readable Nix store and process list). They | ||
| # are managed on the machine in System Settings -> Networking -> | ||
| # Remote Desktop (the KCM ships in this same package) and are stored | ||
| # by KWallet, never in the repo. | ||
| # - TLS: if no certificate is configured, krdpserver generates a | ||
| # temporary self-signed one; the KCM can also generate a persistent | ||
| # on-machine pair. Nothing certificate-like is committed either. | ||
| # | ||
| # One-time on-machine setup (after the switch that lands this): | ||
| # 1. Open System Settings -> Networking -> Remote Desktop. | ||
| # 2. Add the RDP user and password that clients will connect with. | ||
| # 3. Leave the port at 3389. No firewall change is needed or wanted: | ||
| # the host firewall opens no TCP ports, but tailscale0 is a | ||
| # trusted interface (nixos/abstract/tailscale-autoconnect), so the | ||
| # server is reachable over Tailscale only -- never the LAN. | ||
| # Until step 2 is done the service runs but has no user that can log | ||
| # in, which is the safe default. | ||
| home-manager.users.user = { | ||
| home.packages = [ pkgs.kdePackages.krdp ]; | ||
|
|
||
| systemd.user.services.app-org.kde.krdpserver = { | ||
| Unit = { | ||
| Description = "KRDP Server"; | ||
| After = [ | ||
| "plasma-xdg-desktop-portal-kde.service" | ||
| "plasma-core.target" | ||
| ]; | ||
| }; | ||
| Service = { | ||
| Type = "exec"; | ||
| ExecStart = "${pkgs.kdePackages.krdp}/bin/krdpserver"; | ||
| Restart = "on-abnormal"; | ||
| }; | ||
| Install.WantedBy = [ "plasma-workspace.target" ]; | ||
| }; | ||
| }; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the amd host, the desktop profile enables Hyprland with GNOME as a fallback (
nixos/desktop/default.nixandnixos/services/default.nix:78-94); Plasma is not enabled. Consequently, normal logins never activateplasma-workspace.target, so this service will not start after the documented rebuild and credential setup, leaving the new remote-desktop feature unavailable. Configure a supported Plasma session or use a remote-desktop implementation compatible with the host's existing session; changing the target alone would not supply the missing Plasma dependencies.Useful? React with 👍 / 👎.