From c8610cb1cdfe2ffc360a14ae52cee97d4e915035 Mon Sep 17 00:00:00 2001 From: Seth Flynn Date: Sun, 30 Mar 2025 21:38:57 -0400 Subject: chore(nix): use date for version --- nix/package.nix | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/nix/package.nix b/nix/package.nix index 1c9cc4e..483c786 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -11,9 +11,27 @@ optimizeSize ? false, }: +let + inherit (self) lastModifiedDate; + date = + let + year = lib.substring 0 4 lastModifiedDate; + month = lib.substring 4 2 lastModifiedDate; + day = lib.substring 6 2 lastModifiedDate; + in + if (self ? "lastModifiedDate") then + lib.concatStringsSep "-" [ + year + month + day + ] + else + "0"; +in + rustPlatform.buildRustPackage { pname = "nixpkgs-tracker-bot"; - version = self.shortRev or self.dirtyShortRev or "unknown"; + version = "0.2.0-unstable-${date}"; src = lib.fileset.toSource { root = ../.; @@ -65,7 +83,7 @@ rustPlatform.buildRustPackage { }; meta = { - description = "A Discord app for tracking nixpkgs pull requests"; + description = "Discord app for tracking Nixpkgs pull requests"; homepage = "https://github.com/getchoo/nixpkgs-tracker-bot"; license = lib.licenses.mit; maintainers = [ lib.maintainers.getchoo ]; -- cgit v1.2.3