]> Untitled Git - awful.systems.git/blobdiff - lemmy/server.nix
update lemmy to 0.18.2
[awful.systems.git] / lemmy / server.nix
index a76ce53bc7d522dddfaf849b42522ba86e67dd7c..fa016593bb08605b618662a67dff7d7b024aa916 100644 (file)
@@ -1,20 +1,9 @@
-{ 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 {
+  version = pinData.serverVersion;
+in rustPlatform.buildRustPackage rec {
   inherit version;
   pname = "lemmy-server";
 
@@ -26,6 +15,10 @@ rustPlatform.buildRustPackage rec {
     fetchSubmodules = true;
   };
 
+  preConfigure = ''
+    echo 'pub const VERSION: &str = "${version}";' > crates/utils/src/version.rs
+  '';
+
   cargoSha256 = pinData.serverCargoSha256;
 
   buildInputs = [ postgresql ]
@@ -42,7 +35,7 @@ rustPlatform.buildRustPackage rec {
   PROTOC_INCLUDE = "${protobuf}/include";
   nativeBuildInputs = [ protobuf rustfmt ];
 
-  passthru.updateScript = ./update.sh;
+  passthru.updateScript = ./update.py;
   passthru.tests.lemmy-server = nixosTests.lemmy;
 
   doCheck = false;