python3Packages.nmcli: init at 1.5.0

This commit is contained in:
ktechmidas
2025-08-27 15:06:52 +03:00
parent e597e50ab4
commit e91003d551
3 changed files with 55 additions and 0 deletions
@@ -0,0 +1,42 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
replaceVars,
setuptools,
wheel,
networkmanager,
}:
buildPythonPackage rec {
pname = "nmcli";
version = "1.5.0";
pyproject = true;
src = fetchFromGitHub {
owner = "ushiboy";
repo = "nmcli";
tag = "v${version}";
hash = "sha256-1gVj4WfTx1NcoyWA9OK5EyGze9hmrXV0Mq50C1S3bfM=";
};
build-system = [
setuptools
wheel
];
patches = [
(replaceVars ./nmcli-path.patch {
nmcli = lib.getExe' networkmanager "nmcli";
})
];
meta = {
description = "Python library for interacting with NetworkManager CLI";
homepage = "https://github.com/ushiboy/nmcli";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ ktechmidas ];
inherit (networkmanager.meta) platforms;
changelog = "https://github.com/ushiboy/nmcli/releases/tag/v${version}";
};
}
@@ -0,0 +1,11 @@
--- a/nmcli/_system.py
+++ b/nmcli/_system.py
@@ -43,7 +43,7 @@ class System:
def nmcli(self, parameters: CommandParameter) -> str:
if isinstance(parameters, str):
parameters = [parameters]
- c = ['sudo', 'nmcli'] if self._use_sudo else ['nmcli']
+ c = ['sudo', '@nmcli@'] if self._use_sudo else ['@nmcli@']
commands = c + parameters
try:
env = dict(os.environ, **{'LANG': self._lang})
+2
View File
@@ -10461,6 +10461,8 @@ self: super: with self; {
nmapthon2 = callPackage ../development/python-modules/nmapthon2 { };
nmcli = callPackage ../development/python-modules/nmcli { };
nnpdf = toPythonModule (pkgs.nnpdf.override { python3 = python; });
noaa-coops = callPackage ../development/python-modules/noaa-coops { };