2022-09-09 14:08:57 +00:00
|
|
|
{ lib, stdenv, fetchurl, appimageTools, undmg }:
|
|
|
|
|
|
|
|
let
|
|
|
|
pname = "passky-desktop";
|
2022-11-02 22:02:43 +00:00
|
|
|
version = "7.1.0";
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
srcs = {
|
|
|
|
x86_64-linux = fetchurl {
|
|
|
|
url = "https://github.com/Rabbit-Company/Passky-Desktop/releases/download/v${version}/Passky-${version}.AppImage";
|
2022-11-02 22:02:43 +00:00
|
|
|
sha256 = "1xnhrmmm018mmyzjq05mhbf673f0n81fh1k3kbfarbgk2kbwpq6y";
|
2022-09-09 14:08:57 +00:00
|
|
|
};
|
|
|
|
x86_64-darwin = fetchurl {
|
|
|
|
url = "https://github.com/Rabbit-Company/Passky-Desktop/releases/download/v${version}/Passky-${version}.dmg";
|
2022-11-02 22:02:43 +00:00
|
|
|
sha256 = "0mm7hk4v7zvpjdqyw3nhk33x72j0gh3f59bx3q18azlm4dr61r2d";
|
2022-09-09 14:08:57 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
src = srcs.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
|
|
|
|
|
|
|
appimageContents = appimageTools.extract { inherit pname version src; };
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://passky.org";
|
|
|
|
downloadPage = "https://github.com/Rabbit-Company/Passky-Desktop/releases";
|
|
|
|
license = licenses.gpl3Only;
|
|
|
|
maintainers = with maintainers; [ akkesm ];
|
|
|
|
platforms = builtins.attrNames srcs;
|
|
|
|
};
|
|
|
|
|
|
|
|
linux = appimageTools.wrapType2 {
|
|
|
|
inherit pname version src meta;
|
|
|
|
|
|
|
|
extraInstallCommands = ''
|
|
|
|
mv $out/bin/${pname}-${version} $out/bin/${pname}
|
|
|
|
|
|
|
|
install -D ${appimageContents}/passky.desktop \
|
|
|
|
$out/share/applications/${pname}.desktop
|
|
|
|
|
|
|
|
substituteInPlace $out/share/applications/${pname}.desktop \
|
|
|
|
--replace 'Exec=AppRun' 'Exec=${pname}'
|
|
|
|
|
|
|
|
cp -r ${appimageContents}/usr/share/icons $out/share
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
darwin = stdenv.mkDerivation {
|
|
|
|
inherit pname version src meta;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ undmg ];
|
|
|
|
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/Applications
|
|
|
|
cp -r *.app $out/Applications
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
in
|
|
|
|
if stdenv.isDarwin
|
|
|
|
then darwin
|
|
|
|
else linux
|