-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
12,614 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
{ lib | ||
, fetchFromGitHub | ||
, makeWrapper | ||
, makeDesktopItem | ||
, copyDesktopItems | ||
, mkYarnPackage | ||
, electron | ||
}: | ||
|
||
mkYarnPackage rec { | ||
pname = "kuro"; | ||
version = "9.0.0"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "davidsmorais"; | ||
repo = pname; | ||
rev = "v${version}"; | ||
sha256 = "sha256-9Z/r5T5ZI5aBghHmwiJcft/x/wTRzDlbIupujN2RFfU="; | ||
}; | ||
|
||
packageJSON = ./package.json; | ||
yarnLock = ./yarn.lock; | ||
yarnNix = ./yarn.nix; | ||
|
||
ELECTRON_SKIP_BINARY_DOWNLOAD = "1"; | ||
|
||
nativeBuildInputs = [ | ||
makeWrapper | ||
copyDesktopItems | ||
]; | ||
|
||
postBuild = '' | ||
pushd deps/kuro | ||
yarn --offline run electron-builder \ | ||
--dir \ | ||
-c.electronDist=${electron}/lib/electron \ | ||
-c.electronVersion=${electron.version} | ||
popd | ||
''; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
# resources | ||
mkdir -p "$out/share/lib/kuro" | ||
cp -r ./deps/kuro/dist/*-unpacked/{locales,resources{,.pak}} "$out/share/lib/kuro" | ||
# icons | ||
install -Dm644 ./deps/kuro/static/Icon.png $out/share/icons/hicolor/1024x1024/apps/kuro.png | ||
# 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 | ||
''; | ||
# Do not attempt generating a tarball for contents again. | ||
# note: `doDist = false;` does not work. | ||
distPhase = "true"; | ||
|
||
desktopItems = [ | ||
(makeDesktopItem { | ||
name = pname; | ||
exec = pname; | ||
icon = pname; | ||
desktopName = "Kuro"; | ||
genericName = "Microsoft To-Do Client"; | ||
comment = meta.description; | ||
categories = [ "Office" ]; | ||
startupWMClass = pname; | ||
}) | ||
]; | ||
|
||
meta = with lib; { | ||
description = "An unofficial, featureful, open source, community-driven, free Microsoft To-Do app"; | ||
homepage = "https://github.com/davidsmorais/kuro"; | ||
license = licenses.mit; | ||
maintainers = with maintainers; [ ChaosAttractor ]; | ||
inherit (electron.meta) platforms; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
{ | ||
"name": "kuro", | ||
"productName": "Kuro", | ||
"version": "9.0.0", | ||
"description": "Elegant Microsoft To-Do desktop app (Ao fork)", | ||
"license": "MIT", | ||
"repository": "davidsmorais/kuro", | ||
"author": { | ||
"name": "davidsmorais", | ||
"email": "david@dsmorais.com", | ||
"url": "https://github.com/davidsmorais" | ||
}, | ||
"maintainers": [ | ||
{ | ||
"name": "davidsmorais", | ||
"email": "david@dsmorais.com", | ||
"url": "https://github.com/davidsmorais" | ||
} | ||
], | ||
"scripts": { | ||
"postinstall": "electron-builder install-app-deps", | ||
"icons": "electron-icon-maker --input=./static/Icon.png --output=./build/", | ||
"test": "xo && stylelint 'src/style/*.css'", | ||
"release": "yarn version && rm -rf dist build && yarn icons && electron-builder --publish never", | ||
"build-snap": "electron-builder --linux snap", | ||
"build-win": "electron-builder --win", | ||
"start": "electron ." | ||
}, | ||
"dependencies": { | ||
"auto-launch": "^5.0.1", | ||
"electron-context-menu": "^3.6.1", | ||
"electron-debug": "^1.4.0", | ||
"electron-dl": "^2.0.0", | ||
"electron-store": "^8.1.0", | ||
"lodash": "^4.17.21" | ||
}, | ||
"devDependencies": { | ||
"electron": "^22.1.0", | ||
"electron-builder": "^23.6.0", | ||
"electron-icon-maker": "^0.0.5", | ||
"stylelint": "^14.9.1", | ||
"xo": "^0.53.1" | ||
}, | ||
"xo": { | ||
"envs": [ | ||
"browser", | ||
"node" | ||
], | ||
"rules": { | ||
"n/prefer-global/process": 0, | ||
"unicorn/prefer-module": 0, | ||
"unicorn/no-for-loop": 0, | ||
"unicorn/no-array-for-each": 0, | ||
"import/extensions": 0, | ||
"object-curly-spacing": 0, | ||
"quote-props": 0, | ||
"unicorn/prefer-query-selector": 0, | ||
"quotes": [ | ||
"error", | ||
"double" | ||
] | ||
}, | ||
"space": 2 | ||
}, | ||
"stylelint": { | ||
"rules": { | ||
"block-closing-brace-empty-line-before": "never", | ||
"block-closing-brace-newline-after": "always", | ||
"block-no-empty": true, | ||
"block-opening-brace-space-before": "always", | ||
"color-hex-case": "upper", | ||
"color-hex-length": "long", | ||
"color-no-invalid-hex": true, | ||
"comment-no-empty": true, | ||
"declaration-block-semicolon-space-before": "never", | ||
"indentation": 2, | ||
"max-empty-lines": 0, | ||
"no-duplicate-selectors": true | ||
} | ||
}, | ||
"build": { | ||
"appId": "com.davidsmorais.kuro", | ||
"snap": { | ||
"title": "Kuro" | ||
}, | ||
"files": [ | ||
"**/*", | ||
"!media${/*}", | ||
"!docs${/*}" | ||
], | ||
"win": { | ||
"target": [ | ||
{ | ||
"target": "nsis", | ||
"arch": [ | ||
"x64" | ||
] | ||
} | ||
], | ||
"icon": "icons/win/icon.ico", | ||
"publish": { | ||
"provider": "github", | ||
"releaseType": "release" | ||
} | ||
}, | ||
"linux": { | ||
"category": "Office", | ||
"icon": "icons/png", | ||
"description": "Kuro is an unofficial, featureful, open source, community-driven, free Microsoft To-Do app, used by people in more than 120 countries. (Ao fork)", | ||
"synopsis": "Elegant Microsoft To-Do desktop app (Ao fork)", | ||
"publish": { | ||
"provider": "github", | ||
"releaseType": "release" | ||
}, | ||
"target": [ | ||
{ | ||
"target": "AppImage", | ||
"arch": [ | ||
"x64" | ||
] | ||
}, | ||
{ | ||
"target": "deb", | ||
"arch": [ | ||
"x64" | ||
] | ||
}, | ||
{ | ||
"target": "pacman", | ||
"arch": [ | ||
"x64" | ||
] | ||
}, | ||
{ | ||
"target": "rpm", | ||
"arch": [ | ||
"x64" | ||
] | ||
}, | ||
{ | ||
"target": "snap", | ||
"arch": [ | ||
"x64" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} |
Oops, something went wrong.