todesk: init at 4.7.2.0 (#310474)
This commit is contained in:
commit
1579b92dd4
@ -124,6 +124,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:
|
||||
|
@ -929,6 +929,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
|
||||
|
45
nixos/modules/services/monitoring/todesk.nix
Normal file
45
nixos/modules/services/monitoring/todesk.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
144
pkgs/by-name/to/todesk/package.nix
Normal file
144
pkgs/by-name/to/todesk/package.nix
Normal file
@ -0,0 +1,144 @@
|
||||
{
|
||||
stdenv,
|
||||
lib,
|
||||
procps,
|
||||
fetchurl,
|
||||
dpkg,
|
||||
writeShellScript,
|
||||
buildFHSEnv,
|
||||
nspr,
|
||||
kmod,
|
||||
systemdMinimal,
|
||||
glib,
|
||||
pulseaudio,
|
||||
libXext,
|
||||
libX11,
|
||||
libXrandr,
|
||||
glibc,
|
||||
cairo,
|
||||
libva,
|
||||
libdrm,
|
||||
coreutils,
|
||||
libXi,
|
||||
libGL,
|
||||
bash,
|
||||
libXcomposite,
|
||||
libXdamage,
|
||||
libXfixes,
|
||||
libXtst,
|
||||
nss,
|
||||
libXxf86vm,
|
||||
gtk3,
|
||||
gdk-pixbuf,
|
||||
pango,
|
||||
libz,
|
||||
libayatana-appindicator,
|
||||
}:
|
||||
|
||||
let
|
||||
version = "4.7.2.0";
|
||||
todesk-unwrapped = stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "todesk-unwrapped";
|
||||
version = version;
|
||||
src = fetchurl {
|
||||
url = "https://newdl.todesk.com/linux/todesk-v${finalAttrs.version}-amd64.deb";
|
||||
hash = "sha256-v7VpXXFVaKI99RpzUWfAc6eE7NHGJeFrNeUTbVuX+yg=";
|
||||
curlOptsList = [
|
||||
"--user-agent"
|
||||
"Mozilla/5.0"
|
||||
];
|
||||
};
|
||||
nativeBuildInputs = [ dpkg ];
|
||||
|
||||
unpackPhase = ''
|
||||
runHook preUnpack
|
||||
dpkg -x $src ./todesk-src
|
||||
runHook postUnpack
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p "$out/lib"
|
||||
cp -r todesk-src/* "$out"
|
||||
cp "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1" "$out/opt/todesk/bin/libappindicator3.so.1"
|
||||
mv "$out/opt/todesk/bin" "$out/bin"
|
||||
cp "$out/bin/libmfx.so.1" "$out/lib"
|
||||
cp "$out/bin/libglut.so.3" "$out/lib"
|
||||
mkdir "$out/opt/todesk/config"
|
||||
mkdir "$out/opt/todesk/bin"
|
||||
mkdir -p "$out/share/applications"
|
||||
mkdir "$out/share/icons"
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
});
|
||||
|
||||
in
|
||||
buildFHSEnv {
|
||||
inherit version;
|
||||
name = "todesk";
|
||||
targetPkgs = pkgs: [
|
||||
todesk-unwrapped
|
||||
pulseaudio
|
||||
nspr
|
||||
kmod
|
||||
libXi
|
||||
systemdMinimal
|
||||
glib
|
||||
libz
|
||||
bash
|
||||
coreutils
|
||||
libX11
|
||||
libXext
|
||||
libXrandr
|
||||
glibc
|
||||
libdrm
|
||||
libGL
|
||||
procps
|
||||
cairo
|
||||
libXcomposite
|
||||
libXdamage
|
||||
libXfixes
|
||||
libXtst
|
||||
nss
|
||||
libXxf86vm
|
||||
gtk3
|
||||
gdk-pixbuf
|
||||
pango
|
||||
libva
|
||||
];
|
||||
extraBwrapArgs = [
|
||||
"--bind /var/lib/todesk /opt/todesk/config" # create the folder before bind to avoid permission denided.
|
||||
"--bind ${todesk-unwrapped}/bin /opt/todesk/bin"
|
||||
"--bind /var/lib/todesk /etc/todesk" # service write uuid here. Such a pain!
|
||||
]; # soft link doesn't work so that we should bind ourselves
|
||||
runScript = writeShellScript "ToDesk.sh" ''
|
||||
export LIBVA_DRIVER_NAME=iHD
|
||||
export LIBVA_DRIVERS_PATH=${todesk-unwrapped}/bin
|
||||
if [ "''${1}" = 'service' ]
|
||||
then
|
||||
/opt/todesk/bin/ToDesk_Service
|
||||
else
|
||||
/opt/todesk/bin/ToDesk
|
||||
fi
|
||||
''; # a small script to choose what to exec
|
||||
extraInstallCommands = ''
|
||||
mkdir -p "$out/share/applications"
|
||||
mkdir -p "$out/share/icons"
|
||||
cp ${todesk-unwrapped}/usr/share/applications/todesk.desktop $out/share/applications
|
||||
cp -rf ${todesk-unwrapped}/usr/share/icons/* $out/share/icons
|
||||
substituteInPlace "$out/share/applications/todesk.desktop" \
|
||||
--replace-fail '/opt/todesk/bin/ToDesk' "$out/bin/todesk desktop"
|
||||
substituteInPlace "$out/share/applications/todesk.desktop" \
|
||||
--replace-fail '/opt/todesk/bin' "${todesk-unwrapped}/lib"
|
||||
'';
|
||||
meta = {
|
||||
description = "Remote Desktop Application";
|
||||
homepage = "https://www.todesk.com/linux.html";
|
||||
license = lib.licenses.unfree;
|
||||
platforms = [ "x86_64-linux" ];
|
||||
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
||||
maintainers = with lib.maintainers; [ bot-wxt1221 ];
|
||||
mainProgram = "todesk";
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user