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/<hash>-9router-<shortsha> 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.
This commit is contained in:
asepharyana
2026-09-23 14:03:08 +07:00
parent 8ae771b561
commit 3f0d904d1d
+8 -1
View File
@@ -9,6 +9,13 @@
outputs = { self, nixpkgs, flake-utils }: outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let let
# Build identifier = the git commit this flake was built from, so the
# nix store path is "-9router-<shortsha>" 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 { pkgs = import nixpkgs {
inherit system; inherit system;
overlays = [ overlays = [
@@ -27,7 +34,7 @@
in { in {
packages.default = pkgs.stdenv.mkDerivation { packages.default = pkgs.stdenv.mkDerivation {
pname = "9router"; pname = "9router";
version = "0.5.86"; version = rev;
src = ./.; src = ./.;
nativeBuildInputs = [ nativeBuildInputs = [