nmgui: init at 1.0.0 (#436160)

This commit is contained in:
Philip Taron
2025-08-27 06:09:05 -07:00
committed by GitHub
5 changed files with 143 additions and 0 deletions
+6
View File
@@ -13892,6 +13892,12 @@
github = "KSJ2000";
githubId = 184105270;
};
ktechmidas = {
email = "daniel@ktechmidas.net";
github = "ktechmidas";
githubId = 9920871;
name = "Monotoko";
};
ktf = {
email = "giulio.eulisse@cern.ch";
github = "ktf";
+82
View File
@@ -0,0 +1,82 @@
{
lib,
python3Packages,
fetchFromGitHub,
wrapGAppsHook4,
gobject-introspection,
gtk4,
glib,
makeDesktopItem,
copyDesktopItems,
networkmanager,
}:
python3Packages.buildPythonApplication rec {
pname = "nmgui";
version = "1.0.0";
format = "other";
src = fetchFromGitHub {
owner = "s-adi-dev";
repo = "nmgui";
tag = "v${version}";
hash = "sha256-HS/n40Ng8S5N14DtEH/upwlxdzwCoOEJA40EMdCcLw4=io";
};
nativeBuildInputs = [
wrapGAppsHook4
gobject-introspection
copyDesktopItems
];
buildInputs = [
gtk4
glib
];
dependencies = with python3Packages; [
pygobject3
nmcli
];
desktopItems = [
(makeDesktopItem {
name = "nmgui";
exec = "nmgui";
icon = "network-wireless-symbolic";
comment = "GTK4-based Network Manager GUI using nmcli";
desktopName = "NM GUI";
categories = [
"Network"
"GTK"
];
startupNotify = true;
})
];
installPhase = ''
runHook preInstall
mkdir -p $out/{bin,share/applications,opt/nmgui}
# Copy the app files
cp -r app $out/opt/nmgui/
runHook postInstall
'';
postFixup = ''
makeWrapper ${python3Packages.python.interpreter} $out/bin/nmgui \
--add-flags "$out/opt/nmgui/app/main.py" \
--prefix PYTHONPATH : "$PYTHONPATH" \
"''${gappsWrapperArgs[@]}"
'';
meta = {
description = "Python library for interacting with NetworkManager CLI";
homepage = "https://github.com/s-adi-dev/nmgui";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [ ktechmidas ];
mainProgram = "nmgui";
inherit (networkmanager.meta) platforms;
changelog = "https://github.com/s-adi-dev/nmgui/releases/tag/v${version}";
};
}
@@ -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
@@ -10459,6 +10459,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 { };