about summary refs log tree commit diff
path: root/nixos/modules/services/desktops/gnome/gnome-remote-desktop.nix
blob: 67af93dd007fb6e5dab0decb5cabb7960c63166a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Remote desktop daemon using Pipewire.
{ config, lib, pkgs, ... }:

with lib;

{
  meta = {
    maintainers = teams.gnome.members;
  };

  # Added 2021-05-07
  imports = [
    (mkRenamedOptionModule
      [ "services" "gnome3" "gnome-remote-desktop" "enable" ]
      [ "services" "gnome" "gnome-remote-desktop" "enable" ]
    )
  ];

  ###### interface
  options = {
    services.gnome.gnome-remote-desktop = {
      enable = mkEnableOption "Remote Desktop support using Pipewire";
    };
  };

  ###### implementation
  config = mkIf config.services.gnome.gnome-remote-desktop.enable {
    services.pipewire.enable = true;
    services.dbus.packages = [ pkgs.gnome.gnome-remote-desktop ];

    environment.systemPackages = [ pkgs.gnome.gnome-remote-desktop ];

    systemd.packages = [ pkgs.gnome.gnome-remote-desktop ];
    systemd.tmpfiles.packages = [ pkgs.gnome.gnome-remote-desktop ];

    # TODO: if possible, switch to using provided g-r-d sysusers.d
    users = {
      users.gnome-remote-desktop = {
        isSystemUser = true;
        group = "gnome-remote-desktop";
        home = "/var/lib/gnome-remote-desktop";
      };
      groups.gnome-remote-desktop = { };
    };
  };
}