Kieran's opinionated (and probably slightly dumb) nix config

feat: add gastrack

dunkirk.sh 9d205408 15572c65

verified
+49
+22
machines/terebithia/default.nix
··· 170 170 file = ../../secrets/triage-agent.age; 171 171 owner = "triage-agent"; 172 172 }; 173 + gastrack = { 174 + file = ../../secrets/gastrack.age; 175 + owner = "gastrack"; 176 + }; 173 177 174 178 "restic/env".file = ../../secrets/restic/env.age; 175 179 "restic/repo".file = ../../secrets/restic/repo.age; ··· 559 563 atelier.services.triage-agent = { 560 564 enable = true; 561 565 secretsFile = config.age.secrets.triage-agent.path; 566 + }; 567 + 568 + atelier.services.gastrack = { 569 + enable = true; 570 + domain = "gastrack.dunkirk.sh"; 571 + repository = "https://github.com/taciturnaxolotl/gastrack"; 572 + secretsFile = config.age.secrets.gastrack.path; 573 + healthUrl = "https://gastrack.dunkirk.sh/health"; 574 + environment.FLARESOLVERR_URL = "http://localhost:8191"; 575 + }; 576 + 577 + # FlareSolverr — Cloudflare bypass proxy for GasBuddy scraping 578 + virtualisation.docker.enable = true; 579 + virtualisation.oci-containers.backend = "docker"; 580 + virtualisation.oci-containers.containers.flaresolverr = { 581 + image = "ghcr.io/flaresolverr/flaresolverr:latest"; 582 + ports = [ "127.0.0.1:8191:8191" ]; 583 + environment.LOG_LEVEL = "info"; 562 584 }; 563 585 564 586 services.caddy.virtualHosts."terebithia.dunkirk.sh" = {
+24
modules/nixos/services/gastrack.nix
··· 1 + # Gastrack - Personal gas price cache server 2 + 3 + let 4 + mkService = import ../../lib/mkService.nix; 5 + in 6 + 7 + mkService { 8 + name = "gastrack"; 9 + description = "Gastrack gas price cache server"; 10 + defaultPort = 7878; 11 + runtime = "bun"; 12 + 13 + entryPoint = "api/src/index.ts"; 14 + 15 + extraConfig = cfg: { 16 + systemd.services.gastrack.serviceConfig.Environment = [ 17 + "DB_PATH=${cfg.dataDir}/data/gastrack.db" 18 + ]; 19 + 20 + atelier.services.gastrack.data = { 21 + sqlite = "${cfg.dataDir}/data/gastrack.db"; 22 + }; 23 + }; 24 + }
secrets/gastrack.age

This is a binary file and will not be displayed.

+3
secrets/secrets.nix
··· 87 87 "triage-agent.age".publicKeys = [ 88 88 kierank 89 89 ]; 90 + "gastrack.age".publicKeys = [ 91 + kierank 92 + ]; 90 93 }