From a5a100c66b53209303ecb92143938f228ecb49a5 Mon Sep 17 00:00:00 2001 From: haruki7049 Date: Mon, 1 Jul 2024 11:58:26 +0900 Subject: [PATCH] chore: Edit mkBinaryInstall --- default.nix | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/default.nix b/default.nix index 623fc4e..bf4695e 100644 --- a/default.nix +++ b/default.nix @@ -1,23 +1,15 @@ self: super: let - inherit (super.stdenv.hostPlatform) system; + lib = super.lib; + fetchurl = super.fetchurl; rpath = super.lib.makeLibraryPath [ super.pkgs.gcc-unwrapped ]; mkBinaryInstall = { pname ? "surrealdb", version, url, sha256 }: super.stdenv.mkDerivation rec { inherit pname version; - src = { - x86_64-linux = super.fetchurl { - url = - "https://github.com/surrealdb/surrealdb/releases/download/v${version}/surreal-v${version}.linux-amd64.tgz"; - hash = "sha256-JaHfiAZFgKP5RS0GCQBakYKHPnIqOtds1J65yTznGoI="; - }; - aarch64-linux = super.fetchurl { - url = - "https://github.com/surrealdb/surrealdb/releases/download/v${version}/surreal-v${version}.linux-arm64.tgz"; - hash = "sha256-hlMtgEaonW41TTd2Ilrx3oXY5mdnZjfccPmg4x/6qnU="; - }; - }.${system}; + src = fetchurl { + inherit url sha256; + }; sourceRoot = "."; @@ -35,7 +27,7 @@ let patchelf --set-rpath ${rpath} "$out/bin/surreal" || true ''; - meta = with super.lib; { + meta = with lib; { description = "A scalable, distributed, collaborative, document-graph database, for the realtime web"; homepage = "https://surrealdb.com/";