-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(directory-structure): Add nix directory
- Loading branch information
1 parent
341134b
commit 4b83566
Showing
2 changed files
with
46 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,13 @@ | ||
self: super: | ||
let | ||
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 = fetchurl { inherit url sha256; }; | ||
|
||
sourceRoot = "."; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
mkdir -p $out/bin | ||
cp surreal $out/bin/surreal | ||
runHook postInstall | ||
''; | ||
|
||
postFixup = '' | ||
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$out/bin/surreal" || true | ||
patchelf --set-rpath ${rpath} "$out/bin/surreal" || true | ||
''; | ||
|
||
meta = with lib; { | ||
description = "A scalable, distributed, collaborative, document-graph database, for the realtime web"; | ||
homepage = "https://surrealdb.com/"; | ||
mainProgram = "surreal"; | ||
license = licenses.bsl11; | ||
}; | ||
}; | ||
mkBinaryInstall-x86_64-linux = super.callPackage ./nix/mkBinInstall.x86_64-linux.nix { }; | ||
in | ||
{ | ||
surrealdb = { | ||
"1.4.2" = mkBinaryInstall { | ||
"1.4.2" = mkBinaryInstall-x86_64-linux { | ||
version = "1.4.2"; | ||
url = "https://github.com/surrealdb/surrealdb/releases/download/v1.4.2/surreal-v1.4.2.linux-arm64.tgz"; | ||
sha256 = "0xdaz8gy787rf3f3frk7czkdi1fyy5d24xip9lsnx7d88s02slw6"; | ||
url = "https://github.com/surrealdb/surrealdb/releases/download/v1.4.2/surreal-v1.4.2.linux-amd64.tgz"; | ||
sha256 = "10hswwyckfcysindffiaf8z8g0lib800j1id8pws70250s4dz895"; | ||
}; | ||
}; | ||
} |
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,42 @@ | ||
{ | ||
lib, | ||
fetchurl, | ||
stdenv, | ||
rpath ? lib.makeLibraryPath [ gcc-unwrapped ], | ||
gcc-unwrapped, | ||
}: | ||
|
||
{ | ||
pname ? "surrealdb", | ||
version, | ||
url, | ||
sha256, | ||
}: | ||
stdenv.mkDerivation { | ||
inherit pname version; | ||
|
||
src = fetchurl { inherit url sha256; }; | ||
|
||
sourceRoot = "."; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
mkdir -p $out/bin | ||
cp surreal $out/bin/surreal | ||
runHook postInstall | ||
''; | ||
|
||
postFixup = '' | ||
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$out/bin/surreal" || true | ||
patchelf --set-rpath ${rpath} "$out/bin/surreal" || true | ||
''; | ||
|
||
meta = with lib; { | ||
description = "A scalable, distributed, collaborative, document-graph database, for the realtime web"; | ||
homepage = "https://surrealdb.com/"; | ||
mainProgram = "surreal"; | ||
license = licenses.bsl11; | ||
}; | ||
} |