vuls: init at 0.27.0 (#348530)
[NixPkgs.git] / pkgs / applications / misc / passky-desktop / default.nix
blobb668ba94bfafcd5b28b2ad99901d048992461680
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , electron_29
5 , makeWrapper
6 , makeDesktopItem
7 , copyDesktopItems
8 }:
10 let
11   electron = electron_29;
13 stdenv.mkDerivation rec {
14   pname = "passky-desktop";
15   version = "8.1.2";
17   src = fetchFromGitHub {
18     owner = "Rabbit-Company";
19     repo = "Passky-Desktop";
20     rev = "refs/tags/v${version}";
21     sha256 = "sha256-QQ0+qIkDPNCHeWmcF6FkbDrrt/r3fIkNi0dv6XlV1rc=";
22   };
24   nativeBuildInputs = [
25     makeWrapper
26     copyDesktopItems
27   ];
29   installPhase = ''
30     runHook preInstall
32     mkdir -p $out/share/passky
33     cp -r "." "$out/share/passky/electron"
35     local resolution
36     for icon in $out/share/passky/electron/images/icons/icon*.png; do
37       resolution=''${icon%".png"}
38       resolution=''${resolution##*/icon-}
39       mkdir -p "$out/share/icons/hicolor/''${resolution}/apps"
40       ln -s "$icon" "$out/share/icons/hicolor/''${resolution}/apps/passky.png"
41     done
43     mkdir "$out/share/applications"
44     makeWrapper ${electron}/bin/electron "$out/bin/passky" \
45       --add-flags "$out/share/passky/electron/" \
46       --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"
48     runHook postInstall
49   '';
51   desktopItems = [
52     (
53       makeDesktopItem {
54         name = "passky";
55         type = "Application";
56         desktopName = "Passky";
57         comment = "Simple, modern, open source and secure password manager.";
58         icon = "passky";
59         exec = "passky %U";
60         terminal = false;
61         categories = [ "Utility" ];
62         startupWMClass = "Passky";
63       }
64     )
65   ];
67   meta = with lib; {
68     description = "Simple, modern, lightweight, open source and secure password manager";
69     homepage = "https://passky.org";
70     downloadPage = "https://github.com/Rabbit-Company/Passky-Desktop/releases";
71     changelog = "https://github.com/Rabbit-Company/Passky-Desktop/releases/tag/v${version}";
72     license = licenses.gpl3Only;
73     maintainers = with maintainers; [ akkesm ];
74     mainProgram = "passky";
75     platforms = platforms.unix;
76   };