12 , desktopToDarwinBundle
23 stdenv.mkDerivation (finalAttrs: {
24 pname = "redisinsight-electron";
27 src = fetchFromGitHub {
28 owner = "RedisInsight";
29 repo = "RedisInsight";
30 rev = "${finalAttrs.version}";
31 hash = "sha256-esaH10AyEooym/62F5LJL7oP5UmD6T2UX8g/9QniL9s=";
34 offlineCache = fetchYarnDeps {
35 yarnLock = finalAttrs.src + "/yarn.lock";
36 sha256 = "NHKttywAaWAYkciGzYCnm1speHrWsv1t+dxL1DZgM7o=";
39 feOfflineCache = fetchYarnDeps {
40 yarnLock = finalAttrs.src + "/redisinsight/yarn.lock";
41 sha256 = "1S1KNUOtmywQ0eyqVS2oRlhpjcL9eps8CR7AtC9ujSU=";
44 apiOfflineCache = fetchYarnDeps {
45 yarnLock = finalAttrs.src + "/redisinsight/api/yarn.lock";
46 sha256 = "P99+1Dhdg/vznC2KepPrVGNlrofJFydXkZVxgwprIx4=";
49 nativeBuildInputs = [ yarn fixup_yarn_lock nodejs makeWrapper python3 nest-cli libsass pkg-config ]
50 ++ lib.optionals stdenv.isDarwin [ desktopToDarwinBundle ];
52 buildInputs = [ sqlite xdg-utils ];
57 export HOME=$(mktemp -d)
58 yarn config --offline set yarn-offline-mirror $offlineCache
59 fixup_yarn_lock yarn.lock
60 yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive
62 yarn config --offline set yarn-offline-mirror $feOfflineCache
63 fixup_yarn_lock redisinsight/yarn.lock
64 yarn --offline --cwd redisinsight/ --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive
66 yarn config --offline set yarn-offline-mirror $apiOfflineCache
67 fixup_yarn_lock redisinsight/api/yarn.lock
68 yarn --offline --cwd redisinsight/api/ --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive
70 patchShebangs node_modules/
71 patchShebangs redisinsight/node_modules/
72 patchShebangs redisinsight/api/node_modules/
74 mkdir -p "$HOME/.node-gyp/${nodejs.version}"
75 echo 9 >"$HOME/.node-gyp/${nodejs.version}/installVersion"
76 ln -sfv "${nodejs}/include" "$HOME/.node-gyp/${nodejs.version}"
77 export npm_config_nodedir=${nodejs}
80 # Build the sqlite3 package.
81 npm_config_node_gyp="${buildPackages.nodejs}/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" npm rebuild --verbose --sqlite=${sqlite.dev} sqlite3
84 substituteInPlace redisinsight/api/config/default.ts \
85 --replace "process['resourcesPath']" "\"$out/share/redisinsight\"" \
92 yarn config --offline set yarn-offline-mirror $offlineCache
94 pushd node_modules/node-sass
95 LIBSASS_EXT=auto yarn run build --offline
98 yarn --offline build:prod
100 yarn --offline electron-builder \
101 --dir ${if stdenv.isDarwin then "--macos" else "--linux"} ${if stdenv.hostPlatform.isAarch64 then "--arm64" else "--x64"} \
102 -c.electronDist=${electron}/libexec/electron \
103 -c.electronVersion=${electron.version}
112 mkdir -p "$out/share/redisinsight"
113 mkdir -p "$out/share/redisinsight/static/resources/plugins"
114 mkdir -p "$out/share/redisinsight/default"
116 cp -r release/${if stdenv.isDarwin then "darwin-" else "linux-"}${lib.optionalString stdenv.hostPlatform.isAarch64 "arm64-"}unpacked/resources/{app.asar,app.asar.unpacked} $out/share/redisinsight/
117 cp -r resources/ $out/share/redisinsight
120 for icon in "$out/resources/icons/*.png"; do
121 mkdir -p "$out/share/icons/hicolor/$(basename $icon .png)/apps"
122 ln -s "$icon" "$out/share/icons/hicolor/$(basename $icon .png)/apps/redisinsight.png"
125 ln -s "${finalAttrs.desktopItem}/share/applications" "$out/share/applications"
127 makeWrapper '${electron}/bin/electron' "$out/bin/redisinsight" \
128 --add-flags "$out/share/redisinsight/app.asar" \
129 --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \
130 --chdir "$out/share/redisinsight" \
131 --argv0 "$out/share/redisinsight/app.asar"
136 desktopItem = makeDesktopItem {
137 name = "redisinsight";
138 exec = "redisinsight %u";
139 icon = "redisinsight";
140 desktopName = "RedisInsight";
141 genericName = "RedisInsight Redis Client";
142 comment = finalAttrs.meta.description;
143 categories = [ "Development" ];
144 startupWMClass = "redisinsight";
148 description = "RedisInsight Redis client powered by Electron";
149 homepage = "https://github.com/RedisInsight/RedisInsight";
150 license = licenses.sspl;
151 maintainers = with maintainers; [ gmemstr ];
152 platforms = [ "x86_64-linux" ];