Winter a19cd4ffb1 Revert "treewide: replace rev with tag"
This reverts commit 65a333600d5c88a98d674f637d092807cfc12253.

This wasn't tested for correctness with something like fodwatch [0],
and should not have been (self-)merged so quickly, especially without
further review.

It also resulted in the breakage of at least one package [1] (and that's
the one we know of and was caught).

A few packages that were updated in between this commit and this revert
were not reverted back to using `rev`, but other than that, this is a
1:1 revert.

[0]: https://codeberg.org/raphaelr/fodwatch
[1]: https://github.com/NixOS/nixpkgs/pull/396904 / 758551e4587d75882aebc21a04bee960418f8ce9
2025-04-08 02:57:25 -04:00

128 lines
2.7 KiB
Nix

{
buildGoModule,
cairo,
cargo-tauri,
cargo,
esbuild,
fetchFromGitHub,
gdk-pixbuf,
glib-networking,
gobject-introspection,
jq,
lib,
libsoup_3,
makeBinaryWrapper,
moreutils,
nodejs,
openssl,
pango,
pkg-config,
pnpm_9,
rustc,
rustPlatform,
stdenv,
webkitgtk_4_1,
}:
let
esbuild_21-5 =
let
version = "0.21.5";
in
esbuild.override {
buildGoModule =
args:
buildGoModule (
args
// {
inherit version;
src = fetchFromGitHub {
owner = "evanw";
repo = "esbuild";
rev = "v${version}";
hash = "sha256-FpvXWIlt67G8w3pBKZo/mcp57LunxDmRUaCU/Ne89B8=";
};
vendorHash = "sha256-+BfxCyg0KkDQpHt/wycy/8CTG6YBA/VJvJFhhzUnSiQ=";
}
);
};
in
stdenv.mkDerivation (finalAttrs: {
pname = "surrealist";
version = "3.2.4";
src = fetchFromGitHub {
owner = "surrealdb";
repo = "surrealist";
rev = "surrealist-v${finalAttrs.version}";
hash = "sha256-FWNGC0QoEUu1h3e3sfgWmbvqcNNvfWXU7PEjTXxu9Qo=";
};
cargoDeps = rustPlatform.fetchCargoVendor {
inherit (finalAttrs) src;
sourceRoot = "${finalAttrs.src.name}/${finalAttrs.cargoRoot}";
hash = "sha256-Su9ZOPIskV5poeS8pgtri+sZANBpdgnuCsQqE4WKFdA=";
};
pnpmDeps = pnpm_9.fetchDeps {
inherit (finalAttrs) pname version src;
hash = "sha256-oreeV9g16/F7JGLApi0Uq+vTqNhIg7Lg1Z4k00RUOYI=";
};
nativeBuildInputs = [
cargo
cargo-tauri.hook
gobject-introspection
jq
makeBinaryWrapper
moreutils
nodejs
pkg-config
pnpm_9.configHook
rustc
rustPlatform.cargoSetupHook
];
buildInputs = [
cairo
gdk-pixbuf
libsoup_3
openssl
pango
webkitgtk_4_1
];
env = {
ESBUILD_BINARY_PATH = lib.getExe esbuild_21-5;
OPENSSL_NO_VENDOR = 1;
};
cargoRoot = "src-tauri";
buildAndTestSubdir = finalAttrs.cargoRoot;
# Deactivate the upstream update mechanism
postPatch = ''
jq '
.bundle.createUpdaterArtifacts = false |
.plugins.updater = {"active": false, "pubkey": "", "endpoints": []}
' \
src-tauri/tauri.conf.json | sponge src-tauri/tauri.conf.json
'';
postFixup = ''
wrapProgram "$out/bin/surrealist" \
--set GIO_EXTRA_MODULES ${glib-networking}/lib/gio/modules \
--set WEBKIT_DISABLE_COMPOSITING_MODE 1
'';
meta = with lib; {
description = "Surrealist is the ultimate way to visually manage your SurrealDB database";
homepage = "https://surrealdb.com/surrealist";
license = licenses.mit;
mainProgram = "surrealist";
maintainers = with maintainers; [ frankp ];
platforms = platforms.linux;
};
})