diff --git a/pkgs/redlib/default.nix b/pkgs/redlib/default.nix index 9e4a61f..d985768 100644 --- a/pkgs/redlib/default.nix +++ b/pkgs/redlib/default.nix @@ -22,6 +22,9 @@ rustPlatform.buildRustPackage rec { }; patches = [ + # this is so the commit hash can be embedded so redlib doesn't complain + # about the server being outdated unless it's /actually/ outdated + ./no-hash.patch ]; cargoHash = "sha256-ZmIYTDfdMDkxT1doV5kMMjqIHQ/zhiY/ewd77RqRSMU="; @@ -63,6 +66,7 @@ rustPlatform.buildRustPackage rec { env = { SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt"; + GIT_HASH=src.rev; }; passthru.tests = { diff --git a/pkgs/redlib/no-hash.patch b/pkgs/redlib/no-hash.patch new file mode 100644 index 0000000..353edec --- /dev/null +++ b/pkgs/redlib/no-hash.patch @@ -0,0 +1,10 @@ +diff --git a/build.rs b/build.rs +index 0bdbda0..869c7e6 100644 +--- a/build.rs ++++ b/build.rs +@@ -21,5 +21,4 @@ fn main() { + ) + .unwrap_or_default(); + let git_hash = if output == String::default() { "dev".into() } else { output }; +- println!("cargo:rustc-env=GIT_HASH={git_hash}"); + }