From 2e28c9f6db72bd3e5476affa85974831d7484294 Mon Sep 17 00:00:00 2001 From: Acid Bong Date: Sun, 13 Jul 2025 18:34:19 +0300 Subject: [PATCH] rofi-rbw: modernize and cleanup - pyprojectize the recipe - buildInputs were useless - wrapper paths and flags belonged in a `let..in` --- pkgs/by-name/ro/rofi-rbw/package.nix | 64 ++++++++++++---------------- 1 file changed, 27 insertions(+), 37 deletions(-) diff --git a/pkgs/by-name/ro/rofi-rbw/package.nix b/pkgs/by-name/ro/rofi-rbw/package.nix index 54b65be783fe..c6d82037d52b 100644 --- a/pkgs/by-name/ro/rofi-rbw/package.nix +++ b/pkgs/by-name/ro/rofi-rbw/package.nix @@ -16,7 +16,7 @@ python3Packages.buildPythonApplication rec { pname = "rofi-rbw"; version = "1.5.1"; - format = "pyproject"; + pyproject = true; src = fetchFromGitHub { owner = "fdw"; @@ -25,57 +25,47 @@ python3Packages.buildPythonApplication rec { hash = "sha256-Qdbz3UjWMCuJUzR6UMt/apt+OjMAr2U7uMtv9wxEZKE="; }; - nativeBuildInputs = [ + build-system = [ python3Packages.hatchling ]; - buildInputs = [ - rbw - ] - ++ lib.optionals waylandSupport [ - wl-clipboard - wtype - ] - ++ lib.optionals x11Support [ - xclip - xdotool - ]; - - propagatedBuildInputs = [ + dependencies = [ python3Packages.configargparse ]; pythonImportsCheck = [ "rofi_rbw" ]; - wrapper_paths = [ - rbw - ] - ++ lib.optionals waylandSupport [ - wl-clipboard - wtype - ] - ++ lib.optionals x11Support [ - xclip - xdotool - ]; + preFixup = + let + wrapperPaths = [ + rbw + ] + ++ lib.optionals waylandSupport [ + wl-clipboard + wtype + ] + ++ lib.optionals x11Support [ + xclip + xdotool + ]; - wrapper_flags = - lib.optionalString waylandSupport "--typer wtype --clipboarder wl-copy" - + lib.optionalString x11Support "--typer xdotool --clipboarder xclip"; + wrapperFlags = + lib.optionalString waylandSupport " --typer wtype --clipboarder wl-copy" + + lib.optionalString x11Support " --typer xdotool --clipboarder xclip"; + in + '' + makeWrapperArgs+=(--prefix PATH : ${lib.makeBinPath wrapperPaths} --add-flags "${wrapperFlags}") + ''; - preFixup = '' - makeWrapperArgs+=(--prefix PATH : ${lib.makeBinPath wrapper_paths} --add-flags "${wrapper_flags}") - ''; - - meta = with lib; { + meta = { description = "Rofi frontend for Bitwarden"; homepage = "https://github.com/fdw/rofi-rbw"; - license = licenses.mit; - maintainers = with maintainers; [ + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ equirosa dit7ya ]; - platforms = platforms.linux; + platforms = lib.platforms.linux; mainProgram = "rofi-rbw"; }; }