Files
meshexplorer/flake.nix
T
Alex Vanderpot a72c64a008 region system: derive IATA region codes from MQTT topics
Replace hardcoded (broker, topic) region slugs with uppercase IATA codes
derived from the meshcore/{IATA} base topic, discovered dynamically from
data (adding a region needs no code change). Adds region groups, Grafana
region/group filtering, and fixes the neighbor graph.

- regions.ts: single source of truth — regionFromTopic / normalizeRegion /
  regionSql / resolveSelector / selectorLabel. Legacy slugs (seattle->SEA)
  and bare meshcore + meshcore/salish -> SEA still resolve.
- regionGroups.ts + seeded region_groups table: PNW/CAL/DEU/POL.
- migration 004: region ALIAS column on meshcore_packets; 001 views expose
  region / regions[]; reworked neighbor MV (region-scoped, no cross-region
  edges, drops implausible >150km and (0,0) edges); scheduled meshcore_regions MV.
- API/streaming/actions resolve selectors; stream routes drop the hardcoded
  region allow-lists; map node query excludes (0,0) sentinel nodes.
- Dynamic region/group dropdowns (useRegions/RegionSelect); /api/regions.
- Grafana: cascading $region / $region_group template vars + panel filters.
- region-parity.ts (npm run check:regions) guards TS<->SQL drift.
- nix dev shell (flake.nix, Node 24).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-14 15:20:00 -04:00

32 lines
850 B
Nix

{
description = "meshexplorer dev shell (Node + dev deps)";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
outputs = { self, nixpkgs }:
let
forAllSystems = nixpkgs.lib.genAttrs [
"aarch64-darwin"
"x86_64-darwin"
"aarch64-linux"
"x86_64-linux"
];
in
{
devShells = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
# Latest Node LTS (24). Avoids Node 25's experimental localStorage global that
# breaks Next SSR (Node 24 has no localStorage global by default).
default = pkgs.mkShell {
packages = [ pkgs.nodejs_24 ];
shellHook = ''
echo "meshexplorer dev shell node $(node -v), npm $(npm -v)"
'';
};
});
};
}