3
0
Fork 0
forked from mirrors/nixpkgs

nixos/synergy: add encryption support to server (#125002)

Co-authored-by: Joshua Trees <me@jtrees.io>
This commit is contained in:
Sandro 2021-06-12 21:35:04 +02:00 committed by GitHub
commit 3d6416cc20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -70,6 +70,26 @@ in
type = types.bool;
description = "Whether the Synergy server should be started automatically.";
};
tls = {
enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether TLS encryption should be used.
Using this requires a TLS certificate that can be
generated by starting the Synergy GUI once and entering
a valid product key.
'';
};
cert = mkOption {
type = types.nullOr types.str;
default = null;
example = "~/.synergy/SSL/Synergy.pem";
description = "The TLS certificate to use for encryption.";
};
};
};
};
@ -95,7 +115,7 @@ in
description = "Synergy server";
wantedBy = optional cfgS.autoStart "graphical-session.target";
path = [ pkgs.synergy ];
serviceConfig.ExecStart = ''${pkgs.synergy}/bin/synergys -c ${cfgS.configFile} -f ${optionalString (cfgS.address != "") "-a ${cfgS.address}"} ${optionalString (cfgS.screenName != "") "-n ${cfgS.screenName}" }'';
serviceConfig.ExecStart = ''${pkgs.synergy}/bin/synergys -c ${cfgS.configFile} -f${optionalString (cfgS.address != "") " -a ${cfgS.address}"}${optionalString (cfgS.screenName != "") " -n ${cfgS.screenName}"}${optionalString cfgS.tls.enable " --enable-crypto"}${optionalString (cfgS.tls.cert != null) (" --tls-cert=${cfgS.tls.cert}")}'';
serviceConfig.Restart = "on-failure";
};
})