nixos/todesk: init

This commit is contained in:
wxt 2024-08-24 22:26:00 +08:00
parent 0295652d91
commit 1c77c14c21
3 changed files with 48 additions and 0 deletions

View File

@ -109,6 +109,8 @@
- [foot](https://codeberg.org/dnkl/foot), a fast, lightweight and minimalistic Wayland terminal emulator. Available as [programs.foot](#opt-programs.foot.enable).
- [ToDesk](https://www.todesk.com/linux.html), a remote desktop applicaton. Available as [services.todesk.enable](#opt-services.todesk.enable).
## Backward Incompatibilities {#sec-release-24.11-incompatibilities}
- `transmission` package has been aliased with a `trace` warning to `transmission_3`. Since [Transmission 4 has been released last year](https://github.com/transmission/transmission/releases/tag/4.0.0), and Transmission 3 will eventually go away, it was decided perform this warning alias to make people aware of the new version. The `services.transmission.package` defaults to `transmission_3` as well because the upgrade can cause data loss in certain specific usage patterns (examples: [#5153](https://github.com/transmission/transmission/issues/5153), [#6796](https://github.com/transmission/transmission/issues/6796)). Please make sure to back up to your data directory per your usage:

View File

@ -928,6 +928,7 @@
./services/monitoring/teamviewer.nix
./services/monitoring/telegraf.nix
./services/monitoring/thanos.nix
./services/monitoring/todesk.nix
./services/monitoring/tremor-rs.nix
./services/monitoring/tuptime.nix
./services/monitoring/unpoller.nix

View File

@ -0,0 +1,45 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.services.todesk;
in
{
options = {
services.todesk.enable = lib.mkEnableOption "ToDesk daemon";
services.todesk.package = lib.mkPackageOption pkgs "todesk" { };
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ cfg.package ];
systemd.services.todeskd = {
description = "ToDesk Daemon Service";
wantedBy = [ "multi-user.target" ];
wants = [
"network-online.target"
"display-manager.service"
"nss-lookup.target"
];
serviceConfig = {
Type = "simple";
ExecStart = "${cfg.package}/bin/todesk service";
ExecReload = "${pkgs.coreutils}/bin/kill -SIGINT $MAINPID";
Restart = "on-failure";
WorkingDirectory = "/var/lib/todesk";
PrivateTmp = true;
StateDirectory = "todesk";
StateDirectoryMode = "0777"; # Desktop application read and write /opt/todesk/config/config.ini. Such a pain!
ProtectSystem = "strict";
ProtectHome = "read-only";
RemoveIPC = "yes";
};
};
};
}