protonmail desktop
This commit is contained in:
parent
d8d088710b
commit
8fb3ddb0d7
|
@ -70,6 +70,7 @@
|
|||
cpypsk = self.packages.${system}.cpypsk;
|
||||
renoise = self.packages.${system}.renoise;
|
||||
wall = self.packages.${system}.wall;
|
||||
protonmail-desktop = self.packages.${system}.protonmail-desktop;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -119,6 +120,7 @@
|
|||
cpypsk = import ./pkgs/cpypsk.nix { inherit pkgs pash; };
|
||||
renoise = import ./pkgs/renoise.nix { inherit pkgs; };
|
||||
wall = import ./pkgs/wall.nix { inherit pkgs; };
|
||||
protonmail-desktop = import ./pkgs/protonmail-desktop.nix { inherit pkgs; };
|
||||
};
|
||||
});
|
||||
}
|
||||
|
|
|
@ -71,6 +71,6 @@
|
|||
unstable.kicad
|
||||
extra.renoise
|
||||
extra.nixprof
|
||||
unstable.protonmail-desktop
|
||||
extra.protonmail-desktop
|
||||
];
|
||||
}
|
||||
|
|
63
pkgs/protonmail-desktop.nix
Normal file
63
pkgs/protonmail-desktop.nix
Normal file
|
@ -0,0 +1,63 @@
|
|||
{ pkgs, ... }:
|
||||
let mainProgram = "protonmail-desktop";
|
||||
srcHashes = {
|
||||
universal-darwin = "sha256-JfZwHFp0aZtHcbP7tyG7uqFs2w+LWKfnfyuxxpxDJZ8=";
|
||||
x86_64-linux = "sha256-En5vkTHYtwN6GMgbtyhzsPqknOPRO9KlTqZfbBFaIFQ=";
|
||||
};
|
||||
in
|
||||
pkgs.stdenv.mkDerivation rec {
|
||||
pname = "protonmail-desktop";
|
||||
version = "1.0.5";
|
||||
nativeBuildInputs = [
|
||||
pkgs.makeWrapper
|
||||
]
|
||||
++ pkgs.lib.optional pkgs.stdenv.isLinux pkgs.dpkg
|
||||
++ pkgs.lib.optional pkgs.stdenv.isDarwin pkgs.unzip;
|
||||
src = pkgs.fetchurl {
|
||||
url =
|
||||
if pkgs.stdenv.isDarwin then
|
||||
"https://github.com/ProtonMail/inbox-desktop/releases/download/${version}/Proton.Mail-darwin-universal-${version}.zip"
|
||||
else
|
||||
"https://github.com/ProtonMail/inbox-desktop/releases/download/${version}/proton-mail_${version}_amd64.deb";
|
||||
sha256 =
|
||||
{
|
||||
x86_64-linux = srcHashes.x86_64-linux;
|
||||
x86_64-darwin = srcHashes.universal-darwin;
|
||||
aarch64-darwin = srcHashes.universal-darwin;
|
||||
}
|
||||
.${pkgs.stdenv.hostPlatform.system} or (throw "unsupported system ${pkgs.stdenv.hostPlatform.system}");
|
||||
};
|
||||
|
||||
sourceRoot = pkgs.lib.optionalString pkgs.stdenv.isDarwin ".";
|
||||
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
|
||||
installPhase =
|
||||
let
|
||||
darwin = ''
|
||||
mkdir -p $out/{Applications,bin}
|
||||
cp -r "Proton Mail.app" $out/Applications/
|
||||
makeWrapper $out/Applications/"Proton Mail.app"/Contents/MacOS/Proton\ Mail $out/bin/protonmail-desktop
|
||||
'';
|
||||
linux = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out
|
||||
cp -r usr/share/ $out/
|
||||
cp -r usr/lib/ $out/
|
||||
'';
|
||||
|
||||
in
|
||||
''
|
||||
runHook preInstall
|
||||
|
||||
${if pkgs.stdenv.isDarwin then darwin else linux}
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
preFixup = pkgs.lib.optionalString pkgs.stdenv.isLinux ''
|
||||
makeWrapper ${pkgs.steam-run}/bin/steam-run $out/bin/${mainProgram} \
|
||||
--add-flags "$out'/lib/proton-mail/Proton Mail Beta'"
|
||||
'';
|
||||
}
|
Loading…
Reference in New Issue
Block a user