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;
stdenv.mkDerivation rec {
name = "StatusImAppImage";
version = "20181208";
let
package = stdenv.mkDerivation rec {
name = "StatusImAppImage";
version = "20181208";
src =
if stdenv.hostPlatform.system == "x86_64-linux" then
fetchurl {
url = "https://desktop-app-files.ams3.digitaloceanspaces.com/${name}_${version}.zip";
sha256 = "15c6p5v6325kj2whc298dn1dyigi0yzk2nzh1y10d03aqr4j8mp5";
}
else throw "${name} is not supported on ${stdenv.hostPlatform.system}";
src =
if stdenv.hostPlatform.system == "x86_64-linux" then
fetchurl {
url = "https://desktop-app-files.ams3.digitaloceanspaces.com/${name}_${version}.zip";
sha256 = "15c6p5v6325kj2whc298dn1dyigi0yzk2nzh1y10d03aqr4j8mp5";
}
else throw "${name} is not supported on ${stdenv.hostPlatform.system}";
nativeBuildInputs = [ unzip ];
nativeBuildInputs = [ unzip ];
phases = [ "unpackPhase" ];
unpackPhase = ''
mkdir -p $out/src
unzip $src -d $out/src
'';
phases = [ "unpackPhase" ];
unpackPhase = ''
mkdir -p $out/src
unzip $src -d $out/src
'';
meta = {
description = "A base image for Linux Status Desktop release distributions";
homepage = https://desktop-app-files.ams3.digitaloceanspaces.com/;
license = stdenv.lib.licenses.gpl3;
maintainers = [ stdenv.lib.maintainers.pombeirp ];
platforms = stdenv.lib.platforms.linux;
meta = {
description = "A base image for Linux Status Desktop release distributions";
homepage = https://desktop-app-files.ams3.digitaloceanspaces.com/;
license = stdenv.lib.licenses.gpl3;
maintainers = [ stdenv.lib.maintainers.pombeirp ];
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 { };
linuxdeployqt = callPackage ./linuxdeployqt { inherit appimagekit; };
in
{
in {
buildInputs = [ appimagekit linuxdeployqt patchelf baseImage ];
shellHook = ''
export STATUSREACT_LINUX_BASEIMAGE_PATH="${baseImage}/src"
'';
inherit (baseImage) shellHook;
}

View File

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

View File

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