2023-04-12 12:48:02 +00:00
|
|
|
{ lib
|
2024-07-27 06:49:29 +00:00
|
|
|
, stdenv
|
2023-04-12 12:48:02 +00:00
|
|
|
, fetchFromGitHub
|
2023-10-09 19:29:22 +00:00
|
|
|
, fetchYarnDeps
|
2024-07-27 06:49:29 +00:00
|
|
|
, yarnConfigHook
|
|
|
|
, yarnBuildHook
|
|
|
|
, nodejs
|
2023-04-12 12:48:02 +00:00
|
|
|
, makeWrapper
|
|
|
|
, makeDesktopItem
|
|
|
|
, copyDesktopItems
|
2024-10-29 11:11:06 +00:00
|
|
|
, electron
|
2023-04-12 12:48:02 +00:00
|
|
|
}:
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2023-04-12 12:48:02 +00:00
|
|
|
pname = "kuro";
|
|
|
|
version = "9.0.0";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "davidsmorais";
|
2024-04-21 15:54:59 +00:00
|
|
|
repo = "kuro";
|
2023-04-12 12:48:02 +00:00
|
|
|
rev = "v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-9Z/r5T5ZI5aBghHmwiJcft/x/wTRzDlbIupujN2RFfU=";
|
2023-04-12 12:48:02 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
offlineCache = fetchYarnDeps {
|
|
|
|
yarnLock = "${src}/yarn.lock";
|
|
|
|
hash = "sha256-GTiNv7u1QK/wjQgpka7REuoLn2wjZG59kYJQaZZPycI=";
|
|
|
|
};
|
2023-04-12 12:48:02 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
|
2023-04-12 12:48:02 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2024-07-27 06:49:29 +00:00
|
|
|
yarnConfigHook
|
|
|
|
yarnBuildHook
|
|
|
|
nodejs
|
2023-04-12 12:48:02 +00:00
|
|
|
makeWrapper
|
|
|
|
copyDesktopItems
|
|
|
|
];
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
yarnBuildScript = "electron-builder";
|
|
|
|
yarnBuildFlags = [
|
|
|
|
"--dir"
|
2024-09-19 14:19:46 +00:00
|
|
|
"-c.electronDist=${electron.dist}"
|
2024-07-27 06:49:29 +00:00
|
|
|
"-c.electronVersion=${electron.version}"
|
|
|
|
];
|
2023-04-12 12:48:02 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
# resources
|
|
|
|
mkdir -p "$out/share/lib/kuro"
|
2024-07-27 06:49:29 +00:00
|
|
|
cp -r ./dist/*-unpacked/{locales,resources{,.pak}} "$out/share/lib/kuro"
|
2023-04-12 12:48:02 +00:00
|
|
|
|
|
|
|
# icons
|
2024-07-27 06:49:29 +00:00
|
|
|
install -Dm644 ./static/Icon.png $out/share/icons/hicolor/1024x1024/apps/kuro.png
|
2023-04-12 12:48:02 +00:00
|
|
|
|
|
|
|
# executable wrapper
|
|
|
|
makeWrapper '${electron}/bin/electron' "$out/bin/kuro" \
|
|
|
|
--add-flags "$out/share/lib/kuro/resources/app.asar" \
|
|
|
|
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \
|
|
|
|
--inherit-argv0
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
2024-04-21 15:54:59 +00:00
|
|
|
name = "kuro";
|
|
|
|
exec = "kuro";
|
|
|
|
icon = "kuro";
|
2023-04-12 12:48:02 +00:00
|
|
|
desktopName = "Kuro";
|
|
|
|
genericName = "Microsoft To-Do Client";
|
|
|
|
comment = meta.description;
|
|
|
|
categories = [ "Office" ];
|
2024-04-21 15:54:59 +00:00
|
|
|
startupWMClass = "kuro";
|
2023-04-12 12:48:02 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-04-21 15:54:59 +00:00
|
|
|
changelog = "https://github.com/davidsmorais/kuro/releases/tag/${src.rev}";
|
2023-04-12 12:48:02 +00:00
|
|
|
description = "An unofficial, featureful, open source, community-driven, free Microsoft To-Do app";
|
|
|
|
homepage = "https://github.com/davidsmorais/kuro";
|
|
|
|
license = licenses.mit;
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "kuro";
|
2023-04-12 12:48:02 +00:00
|
|
|
maintainers = with maintainers; [ ChaosAttractor ];
|
|
|
|
inherit (electron.meta) platforms;
|
|
|
|
};
|
|
|
|
}
|