nixpkgs/pkgs/by-name/ne/networkmanager-openvpn/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

84 lines
1.7 KiB
Nix

{
stdenv,
lib,
fetchurl,
substituteAll,
openvpn,
gettext,
libxml2,
pkg-config,
file,
networkmanager,
libsecret,
glib,
gtk3,
gtk4,
withGnome ? true,
gnome,
kmod,
libnma,
libnma-gtk4,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "NetworkManager-openvpn";
version = "1.12.0";
src = fetchurl {
url = "mirror://gnome/sources/NetworkManager-openvpn/${lib.versions.majorMinor finalAttrs.version}/NetworkManager-openvpn-${finalAttrs.version}.tar.xz";
sha256 = "kD/UwK69KqescMnYwr7Y35ImVdItdkUUQDVmrom36IY=";
};
patches = [
(substituteAll {
src = ./fix-paths.patch;
inherit kmod openvpn;
})
];
nativeBuildInputs = [
gettext
pkg-config
file
libxml2
];
buildInputs =
[
openvpn
networkmanager
glib
]
++ lib.optionals withGnome [
gtk3
gtk4
libsecret
libnma
libnma-gtk4
];
configureFlags = [
"--with-gnome=${if withGnome then "yes" else "no"}"
"--with-gtk4=${if withGnome then "yes" else "no"}"
"--localstatedir=/" # needed for the management socket under /run/NetworkManager
"--enable-absolute-paths"
];
passthru = {
updateScript = gnome.updateScript {
packageName = "NetworkManager-openvpn";
attrPath = "networkmanager-openvpn";
versionPolicy = "odd-unstable";
};
networkManagerPlugin = "VPN/nm-openvpn-service.name";
};
meta = {
description = "NetworkManager's OpenVPN plugin";
homepage = "https://gitlab.gnome.org/GNOME/NetworkManager-openvpn";
changelog = "https://gitlab.gnome.org/GNOME/NetworkManager-openvpn/-/blob/main/NEWS";
inherit (networkmanager.meta) maintainers platforms;
license = lib.licenses.gpl2Plus;
};
})