Move shellHook to respective Nix expressions

This commit is contained in:
Pedro Pombeiro 2019-05-07 15:51:28 +02:00
parent fca01891ba
commit 62614a71d9
No known key found for this signature in database
GPG Key ID: C4A24185B2AA48A1
5 changed files with 99 additions and 81 deletions

View File

@ -2,31 +2,38 @@
with pkgs; with pkgs;
stdenv.mkDerivation rec { let
name = "StatusImAppImage"; package = stdenv.mkDerivation rec {
version = "20181208"; name = "StatusImAppImage";
version = "20181208";
src = src =
if stdenv.hostPlatform.system == "x86_64-linux" then if stdenv.hostPlatform.system == "x86_64-linux" then
fetchurl { fetchurl {
url = "https://desktop-app-files.ams3.digitaloceanspaces.com/${name}_${version}.zip"; url = "https://desktop-app-files.ams3.digitaloceanspaces.com/${name}_${version}.zip";
sha256 = "15c6p5v6325kj2whc298dn1dyigi0yzk2nzh1y10d03aqr4j8mp5"; sha256 = "15c6p5v6325kj2whc298dn1dyigi0yzk2nzh1y10d03aqr4j8mp5";
} }
else throw "${name} is not supported on ${stdenv.hostPlatform.system}"; else throw "${name} is not supported on ${stdenv.hostPlatform.system}";
nativeBuildInputs = [ unzip ]; nativeBuildInputs = [ unzip ];
phases = [ "unpackPhase" ]; phases = [ "unpackPhase" ];
unpackPhase = '' unpackPhase = ''
mkdir -p $out/src mkdir -p $out/src
unzip $src -d $out/src unzip $src -d $out/src
''; '';
meta = { meta = {
description = "A base image for Linux Status Desktop release distributions"; description = "A base image for Linux Status Desktop release distributions";
homepage = https://desktop-app-files.ams3.digitaloceanspaces.com/; homepage = https://desktop-app-files.ams3.digitaloceanspaces.com/;
license = stdenv.lib.licenses.gpl3; license = stdenv.lib.licenses.gpl3;
maintainers = [ stdenv.lib.maintainers.pombeirp ]; maintainers = [ stdenv.lib.maintainers.pombeirp ];
platforms = stdenv.lib.platforms.linux; platforms = stdenv.lib.platforms.linux;
};
}; };
in package // {
shellHook = ''
export STATUSREACT_LINUX_BASEIMAGE_PATH="${package}/src"
'';
} }

View File

@ -10,11 +10,8 @@ let
appimagekit = callPackage ./appimagekit { }; appimagekit = callPackage ./appimagekit { };
linuxdeployqt = callPackage ./linuxdeployqt { inherit appimagekit; }; linuxdeployqt = callPackage ./linuxdeployqt { inherit appimagekit; };
in in {
{
buildInputs = [ appimagekit linuxdeployqt patchelf baseImage ]; buildInputs = [ appimagekit linuxdeployqt patchelf baseImage ];
shellHook = '' inherit (baseImage) shellHook;
export STATUSREACT_LINUX_BASEIMAGE_PATH="${baseImage}/src"
'';
} }

View File

@ -2,31 +2,38 @@
with pkgs; with pkgs;
stdenv.mkDerivation rec { let
name = "StatusImAppBundle"; package = stdenv.mkDerivation rec {
version = "20181113"; name = "StatusImAppBundle";
version = "20181113";
src = src =
if stdenv.hostPlatform.system == "x86_64-darwin" then if stdenv.hostPlatform.system == "x86_64-darwin" then
fetchurl { fetchurl {
url = "https://desktop-app-files.ams3.digitaloceanspaces.com/Status_${version}.app.zip"; url = "https://desktop-app-files.ams3.digitaloceanspaces.com/Status_${version}.app.zip";
sha256 = "0n8n6p60dwsr4q5v4vq8fffcy5qmqhp03yy95k66q4yic72r0hhz"; sha256 = "0n8n6p60dwsr4q5v4vq8fffcy5qmqhp03yy95k66q4yic72r0hhz";
} }
else throw "${name} is not supported on ${stdenv.hostPlatform.system}"; else throw "${name} is not supported on ${stdenv.hostPlatform.system}";
nativeBuildInputs = [ unzip ]; nativeBuildInputs = [ unzip ];
phases = [ "unpackPhase" ]; phases = [ "unpackPhase" ];
unpackPhase = '' unpackPhase = ''
mkdir -p $out/src mkdir -p $out/src
unzip $src -d $out/src unzip $src -d $out/src
''; '';
meta = { meta = {
description = "A base image for macOS Status Desktop release distributions"; description = "A base image for macOS Status Desktop release distributions";
homepage = https://desktop-app-files.ams3.digitaloceanspaces.com/; homepage = https://desktop-app-files.ams3.digitaloceanspaces.com/;
license = stdenv.lib.licenses.gpl3; license = stdenv.lib.licenses.gpl3;
maintainers = [ stdenv.lib.maintainers.pombeirp ]; maintainers = [ stdenv.lib.maintainers.pombeirp ];
platforms = stdenv.lib.platforms.darwin; platforms = stdenv.lib.platforms.darwin;
};
}; };
in package // {
shellHook = ''
export STATUSREACT_MACOS_BASEIMAGE_PATH="${package}/src"
'';
} }

View File

@ -4,39 +4,46 @@ with pkgs;
assert stdenv.isLinux; assert stdenv.isLinux;
stdenv.mkDerivation rec { let
name = "StatusIm-Windows-base-image"; package = stdenv.mkDerivation rec {
version = "20181113"; name = "StatusIm-Windows-base-image";
version = "20181113";
src = src =
if stdenv.hostPlatform.system == "x86_64-linux" then if stdenv.hostPlatform.system == "x86_64-linux" then
fetchurl { fetchurl {
url = "https://desktop-app-files.ams3.digitaloceanspaces.com/${name}_${version}.zip"; url = "https://desktop-app-files.ams3.digitaloceanspaces.com/${name}_${version}.zip";
sha256 = "1wrxcss63zlwspmw76k549z72hcycxzd9iw4cdh98l4hs2ayzsk3"; sha256 = "1wrxcss63zlwspmw76k549z72hcycxzd9iw4cdh98l4hs2ayzsk3";
} }
else throw "${name} is not supported on ${stdenv.hostPlatform.system}"; else throw "${name} is not supported on ${stdenv.hostPlatform.system}";
nativeBuildInputs = [ unzip ]; nativeBuildInputs = [ unzip ];
phases = [ "unpackPhase" "installPhase" ]; phases = [ "unpackPhase" "installPhase" ];
unpackPhase = '' unpackPhase = ''
mkdir -p $out/src mkdir -p $out/src
unzip $src -d $out/src unzip $src -d $out/src
''; '';
installPhase = '' installPhase = ''
runHook preInstall runHook preInstall
echo $out echo $out
ls $out -al ls $out -al
runHook postInstall runHook postInstall
''; '';
meta = { meta = {
description = "A base image for Windows Status Desktop release distributions"; description = "A base image for Windows Status Desktop release distributions";
homepage = https://desktop-app-files.ams3.digitaloceanspaces.com/; homepage = https://desktop-app-files.ams3.digitaloceanspaces.com/;
license = stdenv.lib.licenses.gpl3; license = stdenv.lib.licenses.gpl3;
maintainers = [ stdenv.lib.maintainers.pombeirp ]; maintainers = [ stdenv.lib.maintainers.pombeirp ];
platforms = stdenv.lib.platforms.linux; platforms = stdenv.lib.platforms.linux;
};
}; };
in package // {
shellHook = ''
export STATUSREACT_WINDOWS_BASEIMAGE_PATH="${package}/src"
'';
} }

View File

@ -18,7 +18,7 @@ in
]; ];
shellHook = '' shellHook = ''
export STATUSREACT_WINDOWS_BASEIMAGE_PATH="${baseImage}/src" ${baseImage.shellHook}
unset QT_PATH unset QT_PATH
''; '';
} }