2023-10-09 19:29:22 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, electron_22
|
|
|
|
, makeWrapper
|
|
|
|
, makeDesktopItem
|
|
|
|
, copyDesktopItems
|
|
|
|
}:
|
2022-09-09 14:08:57 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2022-09-09 14:08:57 +00:00
|
|
|
pname = "passky-desktop";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "8.1.1";
|
2022-09-09 14:08:57 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Rabbit-Company";
|
|
|
|
repo = "Passky-Desktop";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
sha256 = "1ma8s1bngjdzclcc4m5pcmavk38sidaskmz7dgfnv84y35si18dr";
|
2022-09-09 14:08:57 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper copyDesktopItems ];
|
2022-09-09 14:08:57 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2022-09-09 14:08:57 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
mkdir -p $out/share/passky
|
|
|
|
cp -r "." "$out/share/passky/electron"
|
2022-09-09 14:08:57 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
local resolution
|
|
|
|
for icon in $out/share/passky/electron/images/icons/icon*.png; do
|
|
|
|
resolution=''${icon%".png"}
|
|
|
|
resolution=''${resolution##*/icon-}
|
|
|
|
mkdir -p "$out/share/icons/hicolor/''${resolution}/apps"
|
|
|
|
ln -s "$icon" "$out/share/icons/hicolor/''${resolution}/apps/passky.png"
|
|
|
|
done
|
2022-09-09 14:08:57 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
mkdir "$out/share/applications"
|
|
|
|
makeWrapper ${electron_22}/bin/electron "$out/bin/passky" \
|
|
|
|
--add-flags "$out/share/passky/electron/" \
|
|
|
|
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"
|
2022-09-09 14:08:57 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
2022-09-09 14:08:57 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
desktopItems = [
|
|
|
|
(
|
|
|
|
makeDesktopItem {
|
|
|
|
name = "Passky";
|
|
|
|
type = "Application";
|
|
|
|
desktopName = "passky";
|
|
|
|
comment = "Simple, modern, open source and secure password manager.";
|
|
|
|
icon = "passky";
|
|
|
|
exec = "passky %U";
|
|
|
|
categories = [ "Utility" ];
|
|
|
|
startupWMClass = "Passky";
|
|
|
|
}
|
|
|
|
)
|
|
|
|
];
|
2022-09-09 14:08:57 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A simple, modern, lightweight, open source and secure password manager";
|
|
|
|
homepage = "https://passky.org";
|
|
|
|
downloadPage = "https://github.com/Rabbit-Company/Passky-Desktop/releases";
|
|
|
|
changelog = "https://github.com/Rabbit-Company/Passky-Desktop/releases/tag/v${version}";
|
|
|
|
license = licenses.gpl3Only;
|
|
|
|
maintainers = with maintainers; [ akkesm ];
|
|
|
|
mainProgram = "passky";
|
|
|
|
platforms = platforms.unix;
|
2022-09-09 14:08:57 +00:00
|
|
|
};
|
2023-10-09 19:29:22 +00:00
|
|
|
}
|