1
0
forked from nikkuss/pkgs

3 Commits

Author SHA1 Message Date
doloro 3588b81d6b fix(grimoire): not packaged shittly 2026-07-13 14:14:48 +01:00
doloro 1082e52e6b fix(grimoire): dev tool popup 2026-07-13 13:58:34 +01:00
doloro d1c6469384 bump(grimoire): 1.23.0 (#20)
![image.png](/attachments/ad8e7979-c93b-4def-8346-832f3832d3ae)

Reviewed-on: nikkuss/pkgs#20
Co-authored-by: Doloro1978 <doloroo@proton.me>
Co-committed-by: Doloro1978 <doloroo@proton.me>
2026-07-13 16:23:52 +04:00
3 changed files with 37 additions and 27 deletions
+3 -3
View File
@@ -116,12 +116,12 @@
"name": null,
"owner": "Slush97",
"repo": "grimoire",
"rev": "v1.14.2",
"sha256": "sha256-iRZF06kjmJJJOeiUpWm8T2REO/FSdpwc73dOXu6Xs9w=",
"rev": "v1.23.0",
"sha256": "sha256-GY1J/guggCc4fyEQKUoEHmRC8hMcSg6gBKU0maEYSPE=",
"sparseCheckout": [],
"type": "github"
},
"version": "v1.14.2"
"version": "v1.23.0"
},
"neovide": {
"cargoLock": {
+3 -3
View File
@@ -69,13 +69,13 @@
};
grimoire = {
pname = "grimoire";
version = "v1.14.2";
version = "v1.23.0";
src = fetchFromGitHub {
owner = "Slush97";
repo = "grimoire";
rev = "v1.14.2";
rev = "v1.23.0";
fetchSubmodules = false;
sha256 = "sha256-iRZF06kjmJJJOeiUpWm8T2REO/FSdpwc73dOXu6Xs9w=";
sha256 = "sha256-GY1J/guggCc4fyEQKUoEHmRC8hMcSg6gBKU0maEYSPE=";
};
};
neovide = {
@@ -2,7 +2,6 @@
lib,
stdenv,
fetchFromGitHub,
fetchurl,
nodejs_22,
pnpm,
python3,
@@ -34,12 +33,12 @@
pname = "grimoire";
inherit version src;
fetcherVersion = 3;
hash = "sha256-aSjELhEyEbQ7qT8fI5VfIDOHrsgHHL18Dsphm6sA8J4=";
hash = "sha256-X7KLUag9HPHVit0l/tA3BxQZ2/Cj0A5KiG4Oevx2268=";
};
desktopItem = makeDesktopItem {
name = "grimoire";
exec = "/bin/grimoire %u";
exec = "grimoire %u";
desktopName = "Grimoire";
categories = ["Utility"];
mimeTypes = ["x-scheme-handler/grimoire"];
@@ -70,7 +69,12 @@ in
inherit pnpmDeps;
env.GRIMOIRE_SOCIAL_BASE_URL = "https://grimoire-social.slusheliott.workers.dev";
env = {
GRIMOIRE_SOCIAL_BASE_URL = "https://grimoire-social.slusheliott.workers.dev";
# electron-builder must not try to fetch an Electron binary over the
# network; we hand it the Nix one via --config.electronDist below.
ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
};
postPatch = ''
cp -r ${grimoire-social-src} ../grimoire-social
@@ -87,6 +91,9 @@ in
mkdir -p ../grimoire-social/node_modules
ln -sfn "$(realpath node_modules/zod)" ../grimoire-social/node_modules/zod
# Rebuild the better-sqlite3 native addon against the Electron ABI. We do
# this ourselves (and disable electron-builder's own rebuild below) so no
# network fetch of Electron headers is needed inside the sandbox.
(
cd node_modules/better-sqlite3
HOME="$TMPDIR" node \
@@ -95,7 +102,19 @@ in
--nodedir="${electron_40.headers}"
)
# Package the app the same way upstream CI does (release.yml):
# `electron-vite build && electron-builder`. We stop at the unpacked
# `--dir` output instead of building AppImage/deb installers, then wrap
# the Nix Electron around the produced app.asar. Building through
# electron-builder (rather than launching Electron on the raw dist/)
# makes `app.isPackaged` true, which is what disables the dev-only
# DevTools auto-open and the dev vpkmerge lookup path.
export HOME="$TMPDIR"
pnpm exec electron-vite build
pnpm exec electron-builder --linux dir \
--config.npmRebuild=false \
--config.electronDist=${electron_40.dist} \
--config.electronVersion=${electron_40.version}
runHook postBuild
'';
@@ -104,26 +123,17 @@ in
runHook preInstall
mkdir -p $out/lib/grimoire
cp -r dist $out/lib/grimoire/dist
mkdir -p $out/lib/grimoire/resources
cp -r resources/vpkmerge $out/lib/grimoire/resources/vpkmerge
echo '{"name":"grimoire","version":"${version}","main":"dist/main/index.js"}' \
> $out/lib/grimoire/package.json
cp -r node_modules $out/lib/grimoire/node_modules
rm -rf "$out/lib/grimoire/node_modules/@grimoire"
find "$out/lib/grimoire/node_modules" -type l | while read -r link; do
[ -e "$link" ] || rm -f "$link"
done
# electron-builder emits the packaged app (app.asar, app.asar.unpacked,
# and extraResources such as vpkmerge) under release/linux-unpacked/resources.
cp -r release/linux-unpacked/resources $out/lib/grimoire/resources
# Launch the Nix Electron against the packaged asar. process.resourcesPath
# resolves to the directory holding app.asar, so the bundled vpkmerge at
# resources/vpkmerge/ is found at runtime.
mkdir -p $out/bin
makeWrapper ${electron_40}/bin/electron $out/bin/grimoire \
--add-flags "$out/lib/grimoire" \
--set ELECTRON_RESOURCES_PATH "$out/lib/grimoire" \
--set NODE_ENV production
--add-flags "$out/lib/grimoire/resources/app.asar" \
--set NODE_ENV production
runHook postInstall
'';