-{ lib
-, stdenv
-, rustPlatform
-, fetchFromGitHub
-, openssl
-, postgresql
-, libiconv
-, Security
-, protobuf
-, rustfmt
-, nixosTests
-}:
+{ lib, stdenv, rustPlatform, fetchFromGitHub, openssl, postgresql, libiconv
+, Security, protobuf, rustfmt, nixosTests }:
let
pinData = lib.importJSON ./pin.json;
version = pinData.version;
-in
-rustPlatform.buildRustPackage rec {
+in rustPlatform.buildRustPackage rec {
inherit version;
pname = "lemmy-server";
fetchSubmodules = true;
};
+ preConfigure = ''
+ echo "pub const VERSION: &str = \"${version}\";" > "crates/utils/src/version.rs"
+ '';
+
cargoSha256 = pinData.serverCargoSha256;
buildInputs = [ postgresql ]