nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 stdenv,
3 lib,
4 fetchurl,
5 replaceVars,
6 openvpn,
7 gettext,
8 libxml2,
9 pkg-config,
10 file,
11 networkmanager,
12 libsecret,
13 glib,
14 gtk3,
15 gtk4,
16 withGnome ? true,
17 gnome,
18 kmod,
19 libnma,
20 libnma-gtk4,
21}:
22
23stdenv.mkDerivation (finalAttrs: {
24 pname = "NetworkManager-openvpn";
25 version = "1.12.0";
26
27 src = fetchurl {
28 url = "mirror://gnome/sources/NetworkManager-openvpn/${lib.versions.majorMinor finalAttrs.version}/NetworkManager-openvpn-${finalAttrs.version}.tar.xz";
29 sha256 = "kD/UwK69KqescMnYwr7Y35ImVdItdkUUQDVmrom36IY=";
30 };
31
32 patches = [
33 (replaceVars ./fix-paths.patch {
34 inherit kmod openvpn;
35 })
36 ];
37
38 nativeBuildInputs = [
39 gettext
40 glib
41 pkg-config
42 file
43 libxml2
44 ];
45
46 buildInputs = [
47 openvpn
48 networkmanager
49 ]
50 ++ lib.optionals withGnome [
51 gtk3
52 gtk4
53 libsecret
54 libnma
55 libnma-gtk4
56 ];
57
58 configureFlags = [
59 "--with-gnome=${if withGnome then "yes" else "no"}"
60 "--with-gtk4=${if withGnome then "yes" else "no"}"
61 "--localstatedir=/" # needed for the management socket under /run/NetworkManager
62 "--enable-absolute-paths"
63 ];
64
65 strictDeps = true;
66
67 passthru = {
68 updateScript = gnome.updateScript {
69 packageName = "NetworkManager-openvpn";
70 attrPath = "networkmanager-openvpn";
71 versionPolicy = "odd-unstable";
72 };
73 networkManagerPlugin = "VPN/nm-openvpn-service.name";
74 };
75
76 meta = {
77 description = "NetworkManager's OpenVPN plugin";
78 homepage = "https://gitlab.gnome.org/GNOME/NetworkManager-openvpn";
79 changelog = "https://gitlab.gnome.org/GNOME/NetworkManager-openvpn/-/blob/main/NEWS";
80 inherit (networkmanager.meta) maintainers teams platforms;
81 license = lib.licenses.gpl2Plus;
82 };
83})