2020-02-13 17:37:38 +00:00
|
|
|
{ stdenv, lib, fetchurl, makeWrapper, wrapGAppsHook, electron
|
2019-08-30 18:12:04 +01:00
|
|
|
, common-updater-scripts
|
2020-02-13 17:37:38 +00:00
|
|
|
, writeShellScript
|
2019-04-17 18:36:11 +01:00
|
|
|
}:
|
|
|
|
|
2020-02-13 17:37:38 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "stretchly";
|
|
|
|
version = "0.21.1";
|
2019-08-30 18:12:04 +01:00
|
|
|
|
2020-02-13 17:37:38 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/hovancik/stretchly/releases/download/v${version}/stretchly-${version}.tar.xz";
|
|
|
|
sha256 = "0776pywyqylwd33m85l4wdr89x0q9xkrjgliag10fp1bswz844lf";
|
|
|
|
};
|
2019-08-30 18:12:04 +01:00
|
|
|
|
2020-02-13 17:37:38 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
wrapGAppsHook
|
|
|
|
];
|
2019-08-30 18:12:04 +01:00
|
|
|
|
2020-02-13 17:37:38 +00:00
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2019-04-17 18:36:11 +01:00
|
|
|
|
2020-02-13 17:37:38 +00:00
|
|
|
mkdir -p $out/bin $out/share/${pname}/
|
|
|
|
mv resources/app.asar $out/share/${pname}/
|
2019-04-17 18:36:11 +01:00
|
|
|
|
2020-02-13 17:37:38 +00:00
|
|
|
makeWrapper ${electron}/bin/electron $out/bin/${pname} \
|
|
|
|
--add-flags $out/share/${pname}/app.asar \
|
|
|
|
"''${gappsWrapperArgs[@]}" \
|
|
|
|
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc.lib ]}"
|
2019-04-17 18:36:11 +01:00
|
|
|
|
2020-02-13 17:37:38 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
2019-04-17 18:36:11 +01:00
|
|
|
|
2019-08-30 18:12:04 +01:00
|
|
|
|
|
|
|
passthru = {
|
2020-02-13 17:37:38 +00:00
|
|
|
updateScript = writeShellScript "update-stretchly" ''
|
2019-08-30 18:12:04 +01:00
|
|
|
set -eu -o pipefail
|
|
|
|
|
|
|
|
# get the latest release version
|
|
|
|
latest_version=$(curl -s https://api.github.com/repos/hovancik/stretchly/releases/latest | jq --raw-output .tag_name | sed -e 's/^v//')
|
|
|
|
|
|
|
|
echo "updating to $latest_version..."
|
|
|
|
|
2020-02-13 17:37:38 +00:00
|
|
|
${common-updater-scripts}/bin/update-source-version stretchly "$latest_version"
|
2019-04-17 18:36:11 +01:00
|
|
|
'';
|
2020-02-13 17:37:38 +00:00
|
|
|
};
|
2019-08-30 18:12:04 +01:00
|
|
|
|
2020-02-13 17:37:38 +00:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A break time reminder app";
|
|
|
|
longDescription = ''
|
|
|
|
stretchly is a cross-platform electron app that reminds you to take
|
|
|
|
breaks when working on your computer. By default, it runs in your tray
|
|
|
|
and displays a reminder window containing an idea for a microbreak for 20
|
|
|
|
seconds every 10 minutes. Every 30 minutes, it displays a window
|
|
|
|
containing an idea for a longer 5 minute break.
|
|
|
|
'';
|
|
|
|
homepage = https://hovancik.net/stretchly;
|
|
|
|
downloadPage = https://hovancik.net/stretchly/downloads/;
|
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = with maintainers; [ cdepillabout ];
|
|
|
|
platforms = platforms.linux;
|
2019-04-17 18:36:11 +01:00
|
|
|
};
|
|
|
|
}
|