1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-18 10:56:53 +00:00
nixpkgs/pkgs/applications/networking/remote/citrix-receiver/wrapper.nix
Maximilian Bosch 10b2208ec5
citrix_receiver: allow custom certs and hooks for the installation
Sometimes it's required to modify some parts of the Citrix build on
their own which is why `{pre,post}Install` hooks can be quite helpful.

Additionally some corporate clients use their own certificates that
aren't stored as trusted ones in the `cacert` package with all of the
trusted certs by Mozilla.

Now it's possible to add custom certs like this:

``` nix
with import <nixpkgs> { config.allowUnfree = true; };

let path = ../../Downloads/custom-corporate-cert.pem; in
citrix_receiver.override {
  extraCerts = [ path ];
}
```
2018-08-06 15:16:16 +02:00

20 lines
514 B
Nix

{ citrix_receiver, extraCerts ? [], symlinkJoin }:
let
mkCertCopy = certPath:
"cp ${certPath} $out/opt/citrix-icaclient/keystore/cacerts/";
in
if builtins.length extraCerts == 0 then citrix_receiver else symlinkJoin {
name = "citrix-with-extra-certs-${citrix_receiver.version}";
paths = [ citrix_receiver ];
postBuild = ''
${builtins.concatStringsSep "\n" (map mkCertCopy extraCerts)}
sed -i -E "s,-icaroot (.+citrix-icaclient),-icaroot $out/opt/citrix-icaclient," $out/bin/wfica
'';
}