From 3f0d904d1d2ed3ea6d6a7458143c42640a121c41 Mon Sep 17 00:00:00 2001 From: asepharyana Date: Wed, 23 Sep 2026 14:03:08 +0700 Subject: [PATCH] chore(nix): version the build by git short SHA instead of package.json semver flake.nix now uses self.shortRev (git HEAD short hash) as the derivation version, so the store path is /nix/store/-9router- and any deployed build traces to its exact source commit. Removes the package.json version bump churn; the updater's deployed/current comparison switches to git SHA. --- flake.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index c4093df0..caf8a4ce 100644 --- a/flake.nix +++ b/flake.nix @@ -9,6 +9,13 @@ outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem (system: let + # Build identifier = the git commit this flake was built from, so the + # nix store path is "-9router-" and a deployed build can be + # traced back to its exact source commit (versioning by git SHA, no + # package.json version bumps needed). Falls back to "dirty" when the + # tree isn't a clean git checkout (self.shortRev is only defined when + # the flake lives in a git repo with no uncommitted changes). + rev = self.shortRev or self.rev or "dirty"; pkgs = import nixpkgs { inherit system; overlays = [ @@ -27,7 +34,7 @@ in { packages.default = pkgs.stdenv.mkDerivation { pname = "9router"; - version = "0.5.86"; + version = rev; src = ./.; nativeBuildInputs = [