nixpkgs/pkgs/by-name/ne/networkmanager_dmenu/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

46 lines
1.4 KiB
Nix

{ lib, stdenv, glib, fetchFromGitHub, networkmanager, python3Packages
, gobject-introspection, procps }:
let inherit (python3Packages) python pygobject3;
in stdenv.mkDerivation rec {
pname = "networkmanager_dmenu";
version = "2.5.0";
src = fetchFromGitHub {
owner = "firecat53";
repo = "networkmanager-dmenu";
rev = "v${version}";
sha256 = "sha256-aw6TwRtlb9x/JOuJqPZTZB2+srlnteEOmYiOPS1tAbM=";
};
nativeBuildInputs = [ gobject-introspection ];
buildInputs = [ glib python pygobject3 networkmanager python3Packages.wrapPython procps ];
dontBuild = true;
installPhase = ''
mkdir -p $out/bin $out/share/applications $out/share/doc/$pname
cp networkmanager_dmenu $out/bin/
cp networkmanager_dmenu.desktop $out/share/applications
cp README.md $out/share/doc/$pname/
cp config.ini.example $out/share/doc/$pname/
'';
postFixup = ''
makeWrapperArgs="\
--prefix GI_TYPELIB_PATH : $GI_TYPELIB_PATH \
--prefix PYTHONPATH : \"$(toPythonPath $out):$(toPythonPath ${pygobject3})\""
wrapPythonPrograms
'';
meta = with lib; {
description = "Small script to manage NetworkManager connections with dmenu instead of nm-applet";
mainProgram = "networkmanager_dmenu";
homepage = "https://github.com/firecat53/networkmanager-dmenu";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.jensbin ];
platforms = lib.platforms.all;
};
}