9 cfg = config.services.todesk;
13 services.todesk.enable = lib.mkEnableOption "ToDesk daemon";
14 services.todesk.package = lib.mkPackageOption pkgs "todesk" { };
17 config = lib.mkIf cfg.enable {
19 environment.systemPackages = [ cfg.package ];
21 systemd.services.todeskd = {
22 description = "ToDesk Daemon Service";
24 wantedBy = [ "multi-user.target" ];
26 "network-online.target"
27 "display-manager.service"
32 ExecStart = "${cfg.package}/bin/todesk service";
33 ExecReload = "${pkgs.coreutils}/bin/kill -SIGINT $MAINPID";
34 Restart = "on-failure";
35 WorkingDirectory = "/var/lib/todesk";
37 StateDirectory = "todesk";
38 StateDirectoryMode = "0777"; # Desktop application read and write /opt/todesk/config/config.ini. Such a pain!
39 ProtectSystem = "strict";
40 ProtectHome = "read-only";