Files
nixpkgs/pkgs/tools/security/pass/rofi-pass.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

110 lines
2.1 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
makeBinaryWrapper,
unstableGitUpdater,
coreutils,
util-linuxMinimal,
gnugrep,
libnotify,
pwgen,
findutils,
gawk,
gnused,
rofi,
# wayland-only deps
pass-wayland,
wl-clipboard,
wtype,
# x11-only deps
pass,
xclip,
xdotool,
# backend selector
backend ? "x11",
}:
assert lib.assertOneOf "backend" backend [
"x11"
"wayland"
];
stdenv.mkDerivation {
pname = "rofi-pass";
version = "2.0.2-unstable-2024-06-16";
src = fetchFromGitHub {
owner = "carnager";
repo = "rofi-pass";
rev = "37c4c862deb133a85b7d72989acfdbd2ef16b8ad";
hash = "sha256-1lPNj47vTPLBK7mVm+PngV8C/ZsjJ2EN4ffXGU2TlQo=";
};
nativeBuildInputs = [ makeBinaryWrapper ];
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp -a rofi-pass $out/bin/rofi-pass
mkdir -p $out/share/doc/rofi-pass/
cp -a config.example $out/share/doc/rofi-pass/config.example
runHook postInstall
'';
wrapperPath = lib.makeBinPath (
[
coreutils
findutils
gawk
gnugrep
gnused
libnotify
pwgen
rofi
util-linuxMinimal
]
++ lib.optionals (backend == "x11") [
(pass.withExtensions (ext: [ ext.pass-otp ]))
xclip
xdotool
]
++ lib.optionals (backend == "wayland") [
(pass-wayland.withExtensions (ext: [ ext.pass-otp ]))
wl-clipboard
wtype
]
);
fixupPhase = ''
runHook preFixup
patchShebangs $out/bin
wrapProgram $out/bin/rofi-pass \
--prefix PATH : "$wrapperPath" \
--set-default ROFI_PASS_BACKEND ${if backend == "wayland" then "wtype" else "xdotool"} \
--set-default ROFI_PASS_CLIPBOARD_BACKEND ${
if backend == "wayland" then "wl-clipboard" else "xclip"
}
runHook postFixup
'';
passthru.updateScript = unstableGitUpdater { };
meta = {
description = "Script to make rofi work with password-store";
mainProgram = "rofi-pass";
homepage = "https://github.com/carnager/rofi-pass";
license = lib.licenses.gpl3;
platforms = with lib.platforms; linux;
maintainers = [ ];
};
}