Loading pkgs/by-name/su/surrealdb-surrealkv/package.nix 0 → 100644 +7 −0 Original line number Diff line number Diff line { _surrealdbPackage, callPackage, }: callPackage _surrealdbPackage { backend = "surrealkv"; } pkgs/by-name/su/surrealdb/package.nix +35 −6 Original line number Diff line number Diff line Loading @@ -7,11 +7,21 @@ rocksdb, testers, protobuf, backend ? "rocksdb", }: let hasRocksDB = backend == "rocksdb"; in assert lib.assertMsg (builtins.elem backend [ "rocksdb" "surrealkv" ]) "surrealdb: backend must be one of [ \"rocksdb\" \"surrealkv\" ]"; rustPlatform.buildRustPackage (finalAttrs: { pname = "surrealdb"; pname = if hasRocksDB then "surrealdb" else "surrealdb-surrealkv"; version = "2.6.1"; __structuredAttrs = true; src = fetchFromGitHub { owner = "surrealdb"; repo = "surrealdb"; Loading @@ -21,19 +31,34 @@ rustPlatform.buildRustPackage (finalAttrs: { cargoHash = "sha256-lebSQPGnxW+3a7vWw3R7QYtHx04/DsRK/n8c/UT3FZo="; # error: linker `aarch64-linux-gnu-gcc` not found # Upstream hard-codes `aarch64-linux-gnu-gcc` in `.cargo/config.toml`. # Remove it so Cargo uses nixpkgs' wrapped C toolchain instead. postPatch = '' rm .cargo/config.toml ''; buildNoDefaultFeatures = true; buildFeatures = [ "allocator" "allocation-tracking" "http" "scripting" "storage-mem" "storage-surrealcs" # Keep this enabled for the default RocksDB build to preserve upstream's # default storage feature set. It can be dropped if `pkgs.surrealdb` is # intentionally slimmed to RocksDB-only in a later change. "storage-surrealkv" ] ++ lib.optional hasRocksDB "storage-rocksdb"; env = { PROTOC = "${protobuf}/bin/protoc"; PROTOC_INCLUDE = "${protobuf}/include"; } // lib.optionalAttrs hasRocksDB { ROCKSDB_INCLUDE_DIR = "${rocksdb}/include"; ROCKSDB_LIB_DIR = "${rocksdb}/lib"; RUSTFLAGS = "--cfg surrealdb_unstable"; }; nativeBuildInputs = [ Loading @@ -60,7 +85,11 @@ rustPlatform.buildRustPackage (finalAttrs: { }; meta = { description = "Scalable, distributed, collaborative, document-graph database, for the realtime web"; description = if hasRocksDB then "Scalable, distributed, collaborative, document-graph database, for the realtime web" else "SurrealDB with the SurrealKV storage backend"; homepage = "https://surrealdb.com/"; mainProgram = "surreal"; license = lib.licenses.bsl11; Loading pkgs/top-level/all-packages.nix +2 −0 Original line number Diff line number Diff line Loading @@ -7947,6 +7947,8 @@ with pkgs; home-assistant-cli = callPackage ../servers/home-assistant/cli.nix { }; _surrealdbPackage = ../by-name/su/surrealdb/package.nix; icingaweb2-ipl = callPackage ../servers/icingaweb2/ipl.nix { }; icingaweb2-thirdparty = callPackage ../servers/icingaweb2/thirdparty.nix { }; icingaweb2 = callPackage ../servers/icingaweb2 { }; Loading Loading
pkgs/by-name/su/surrealdb-surrealkv/package.nix 0 → 100644 +7 −0 Original line number Diff line number Diff line { _surrealdbPackage, callPackage, }: callPackage _surrealdbPackage { backend = "surrealkv"; }
pkgs/by-name/su/surrealdb/package.nix +35 −6 Original line number Diff line number Diff line Loading @@ -7,11 +7,21 @@ rocksdb, testers, protobuf, backend ? "rocksdb", }: let hasRocksDB = backend == "rocksdb"; in assert lib.assertMsg (builtins.elem backend [ "rocksdb" "surrealkv" ]) "surrealdb: backend must be one of [ \"rocksdb\" \"surrealkv\" ]"; rustPlatform.buildRustPackage (finalAttrs: { pname = "surrealdb"; pname = if hasRocksDB then "surrealdb" else "surrealdb-surrealkv"; version = "2.6.1"; __structuredAttrs = true; src = fetchFromGitHub { owner = "surrealdb"; repo = "surrealdb"; Loading @@ -21,19 +31,34 @@ rustPlatform.buildRustPackage (finalAttrs: { cargoHash = "sha256-lebSQPGnxW+3a7vWw3R7QYtHx04/DsRK/n8c/UT3FZo="; # error: linker `aarch64-linux-gnu-gcc` not found # Upstream hard-codes `aarch64-linux-gnu-gcc` in `.cargo/config.toml`. # Remove it so Cargo uses nixpkgs' wrapped C toolchain instead. postPatch = '' rm .cargo/config.toml ''; buildNoDefaultFeatures = true; buildFeatures = [ "allocator" "allocation-tracking" "http" "scripting" "storage-mem" "storage-surrealcs" # Keep this enabled for the default RocksDB build to preserve upstream's # default storage feature set. It can be dropped if `pkgs.surrealdb` is # intentionally slimmed to RocksDB-only in a later change. "storage-surrealkv" ] ++ lib.optional hasRocksDB "storage-rocksdb"; env = { PROTOC = "${protobuf}/bin/protoc"; PROTOC_INCLUDE = "${protobuf}/include"; } // lib.optionalAttrs hasRocksDB { ROCKSDB_INCLUDE_DIR = "${rocksdb}/include"; ROCKSDB_LIB_DIR = "${rocksdb}/lib"; RUSTFLAGS = "--cfg surrealdb_unstable"; }; nativeBuildInputs = [ Loading @@ -60,7 +85,11 @@ rustPlatform.buildRustPackage (finalAttrs: { }; meta = { description = "Scalable, distributed, collaborative, document-graph database, for the realtime web"; description = if hasRocksDB then "Scalable, distributed, collaborative, document-graph database, for the realtime web" else "SurrealDB with the SurrealKV storage backend"; homepage = "https://surrealdb.com/"; mainProgram = "surreal"; license = lib.licenses.bsl11; Loading
pkgs/top-level/all-packages.nix +2 −0 Original line number Diff line number Diff line Loading @@ -7947,6 +7947,8 @@ with pkgs; home-assistant-cli = callPackage ../servers/home-assistant/cli.nix { }; _surrealdbPackage = ../by-name/su/surrealdb/package.nix; icingaweb2-ipl = callPackage ../servers/icingaweb2/ipl.nix { }; icingaweb2-thirdparty = callPackage ../servers/icingaweb2/thirdparty.nix { }; icingaweb2 = callPackage ../servers/icingaweb2 { }; Loading