refactor(nix): use date for version

Helps avoid needless rebuilds where only the revision changed. Also
better conforms to Nixpkgs' version standards

Signed-off-by: Seth Flynn <getchoo@tuta.io>
(cherry picked from commit e9cac2e0e37c4531f662545bdc45b72499654642)
This commit is contained in:
Seth Flynn 2025-03-30 19:19:30 -04:00
parent da9c359184
commit e8bdc72476
No known key found for this signature in database
GPG Key ID: D31BD0D494BBEE86

View File

@ -24,9 +24,28 @@ assert lib.assertMsg (
gamemodeSupport -> stdenv.hostPlatform.isLinux
) "gamemodeSupport is only available on Linux.";
let
date =
let
# YYYYMMDD
date' = lib.substring 0 8 self.lastModifiedDate;
year = lib.substring 0 4 date';
month = lib.substring 4 2 date';
date = lib.substring 6 2 date';
in
if (self ? "lastModifiedDate") then
lib.concatStringsSep "-" [
year
month
date
]
else
"unknown";
in
stdenv.mkDerivation {
pname = "prismlauncher-unwrapped";
version = self.shortRev or self.dirtyShortRev or "unknown";
version = "10.0-unstable-${date}";
src = lib.fileset.toSource {
root = ../.;