Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 stdenv,
3 lib,
4 fetchurl,
5 dpkg,
6 makeBinaryWrapper,
7 glib-networking,
8}:
9
10let
11 dcv-path = "lib/x86_64-linux-gnu/workspacesclient/dcv";
12in
13stdenv.mkDerivation (finalAttrs: {
14 pname = "workspacesclient";
15 version = "2025.0.5296";
16
17 src = fetchurl {
18 urls = [
19 "https://d3nt0h4h6pmmc4.cloudfront.net/ubuntu/dists/jammy/main/binary-amd64/workspacesclient_${finalAttrs.version}_amd64.deb"
20 ];
21 hash = "sha256-VPNZN9AsrGJ56O8B5jxlgLMvrUViTv6yto8c5pGQc0A=";
22 };
23
24 nativeBuildInputs = [
25 dpkg
26 makeBinaryWrapper
27 ];
28
29 installPhase = ''
30 runHook preInstall
31
32 mkdir -p $out
33 cp -R usr/* $out/
34
35 # We introduce a dependency on the source file so that it need not be redownloaded everytime
36 echo $src >> "$out/share/workspace_dependencies.pin"
37
38 runHook postInstall
39 '';
40
41 postFixup = ''
42 # provide network support
43 wrapProgram "$out/bin/workspacesclient" \
44 --set GIO_EXTRA_MODULES ${glib-networking}/lib/gio/modules \
45
46 # dcvclient does not setup the environment correctly.
47 # Instead wrap the binary directly the correct environment paths
48 mv $out/${dcv-path}/dcvclientbin $out/${dcv-path}/dcvclient
49 wrapProgram $out/${dcv-path}/dcvclient \
50 --suffix LD_LIBRARY_PATH : $out/${dcv-path} \
51 --suffix GIO_EXTRA_MODULES : ${dcv-path}/gio/modules \
52 --set DCV_SASL_PLUGIN_DIR $out/${dcv-path}/sasl2 \
53
54 # shrink the install by removing all vendored libraries which will be provided by Nixpkgs
55 find $out/${dcv-path} -name lib\* ! -name libdcv\* ! -name libgioopenssl\* | xargs rm
56 '';
57
58 meta = {
59 description = "Client for Amazon WorkSpaces, a managed, secure Desktop-as-a-Service (DaaS) solution";
60 homepage = "https://clients.amazonworkspaces.com";
61 license = lib.licenses.unfree;
62 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
63 mainProgram = "workspacesclient";
64 maintainers = with lib.maintainers; [
65 mausch
66 dylanmtaylor
67 ];
68 platforms = [ "x86_64-linux" ]; # TODO Mac support
69 };
70})