From e8bdc72476d499378afcce1fe5ab168e2d479f7c Mon Sep 17 00:00:00 2001 From: Seth Flynn Date: Sun, 30 Mar 2025 19:19:30 -0400 Subject: [PATCH] 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 (cherry picked from commit e9cac2e0e37c4531f662545bdc45b72499654642) --- nix/unwrapped.nix | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/nix/unwrapped.nix b/nix/unwrapped.nix index f47051287..2cd127f99 100644 --- a/nix/unwrapped.nix +++ b/nix/unwrapped.nix @@ -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 = ../.;