Co-authored-by: Sandro <sandro.jaeckel@gmail.com> Co-authored-by: sterni <sternenseemann@systemli.org>wip/nixpkgs-raku
parent
6160d7374f
commit
e2b7cfedd6
@ -0,0 +1,43 @@ |
||||
{ config, lib, pkgs, ... }: |
||||
|
||||
with lib; |
||||
|
||||
let |
||||
cfg = config.services.globalprotect; |
||||
|
||||
execStart = if cfg.csdWrapper == null then |
||||
"${pkgs.globalprotect-openconnect}/bin/gpservice" |
||||
else |
||||
"${pkgs.globalprotect-openconnect}/bin/gpservice --csd-wrapper=${cfg.csdWrapper}"; |
||||
in |
||||
|
||||
{ |
||||
options.services.globalprotect = { |
||||
enable = mkEnableOption "globalprotect"; |
||||
|
||||
csdWrapper = mkOption { |
||||
description = '' |
||||
A script that will produce a Host Integrity Protection (HIP) report, |
||||
as described at <link xlink:href="https://www.infradead.org/openconnect/hip.html" /> |
||||
''; |
||||
default = null; |
||||
example = literalExample "\${pkgs.openconnect}/libexec/openconnect/hipreport.sh"; |
||||
type = types.nullOr types.path; |
||||
}; |
||||
}; |
||||
|
||||
config = { |
||||
services.dbus.packages = [ pkgs.globalprotect-openconnect ]; |
||||
|
||||
systemd.services.gpservice = { |
||||
description = "GlobalProtect openconnect DBus service"; |
||||
serviceConfig = { |
||||
Type="dbus"; |
||||
BusName="com.yuezk.qt.GPService"; |
||||
ExecStart=execStart; |
||||
}; |
||||
wantedBy = [ "multi-user.target" ]; |
||||
after = [ "network.target" ]; |
||||
}; |
||||
}; |
||||
} |
@ -0,0 +1,43 @@ |
||||
{ stdenv, lib, fetchFromGitHub |
||||
, qmake, qtwebsockets, qtwebengine, wrapQtAppsHook, openconnect |
||||
}: |
||||
|
||||
stdenv.mkDerivation rec { |
||||
pname = "globalprotect-openconnect"; |
||||
version = "1.2.6"; |
||||
|
||||
src = fetchFromGitHub { |
||||
owner = "yuezk"; |
||||
repo = "GlobalProtect-openconnect"; |
||||
rev = "c14a6ad1d2b62f8d297bc4cfbcb1dcea4d99112f"; |
||||
fetchSubmodules = true; |
||||
sha256 = "1zkc3vk1j31n2zs5ammzv23dah7x163gfrzz222ynbkvsccrhzrk"; |
||||
}; |
||||
|
||||
nativeBuildInputs = [ qmake wrapQtAppsHook ]; |
||||
|
||||
buildInputs = [ openconnect qtwebsockets qtwebengine ]; |
||||
|
||||
patchPhase = '' |
||||
for f in GPClient/GPClient.pro \ |
||||
GPClient/com.yuezk.qt.gpclient.desktop \ |
||||
GPService/GPService.pro \ |
||||
GPService/dbus/com.yuezk.qt.GPService.service \ |
||||
GPService/systemd/gpservice.service; do |
||||
substituteInPlace $f \ |
||||
--replace /usr $out \ |
||||
--replace /etc $out/lib; |
||||
done; |
||||
|
||||
substituteInPlace GPService/gpservice.h \ |
||||
--replace /usr/local/bin/openconnect ${openconnect}/bin/openconnect; |
||||
''; |
||||
|
||||
meta = with lib; { |
||||
description = "GlobalProtect VPN client (GUI) for Linux based on OpenConnect that supports SAML auth mode"; |
||||
homepage = "https://github.com/yuezk/GlobalProtect-openconnect"; |
||||
license = licenses.gpl3Only; |
||||
maintainers = [ maintainers.jerith666 ]; |
||||
platforms = platforms.linux; |
||||
}; |
||||
} |
Loading…
Reference in new issue