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:
parent
da9c359184
commit
e8bdc72476
@ -24,9 +24,28 @@ assert lib.assertMsg (
|
|||||||
gamemodeSupport -> stdenv.hostPlatform.isLinux
|
gamemodeSupport -> stdenv.hostPlatform.isLinux
|
||||||
) "gamemodeSupport is only available on Linux.";
|
) "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 {
|
stdenv.mkDerivation {
|
||||||
pname = "prismlauncher-unwrapped";
|
pname = "prismlauncher-unwrapped";
|
||||||
version = self.shortRev or self.dirtyShortRev or "unknown";
|
version = "10.0-unstable-${date}";
|
||||||
|
|
||||||
src = lib.fileset.toSource {
|
src = lib.fileset.toSource {
|
||||||
root = ../.;
|
root = ../.;
|
||||||
|
Loading…
Reference in New Issue
Block a user