Add infrastructure skeleton for review (refs #21)
check / flake-check (pull_request) Has been cancelled
check / flake-check (pull_request) Has been cancelled
Lays out the agreed shape from the design discussion: one flake at the root with three nixosConfigurations (mqtt-ingest, db-host, app-host), vendored Supabase docker-compose pointed at the external db-host, Caddy → Kong → PostgREST/GoTrue, a Go MQTT→Postgres ingester stub, deploy-rs node map, and a Gitea Actions workflow that deploys in db → app → ingest order on push to main. No real implementation yet — every host module has TODOs marking the gaps (real hardware config, actual hostnames, HiveMQ packaging, vendor the full upstream Supabase compose, etc.).
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
{
|
||||
description = "Gebos — IoT telemetry stack on bare-metal NixOS";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
deploy-rs.url = "github:serokell/deploy-rs";
|
||||
process-compose-flake.url = "github:Platonic-Systems/process-compose-flake";
|
||||
services-flake.url = "github:juspay/services-flake";
|
||||
};
|
||||
|
||||
outputs = inputs@{ self, flake-parts, nixpkgs, deploy-rs, ... }:
|
||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
systems = [ "x86_64-linux" "aarch64-linux" ];
|
||||
|
||||
imports = [
|
||||
inputs.process-compose-flake.flakeModule
|
||||
];
|
||||
|
||||
flake = {
|
||||
nixosModules = import ./nix/modules;
|
||||
nixosConfigurations = import ./nix/hosts { inherit inputs; };
|
||||
deploy = import ./nix/deploy.nix { inherit inputs; };
|
||||
|
||||
# `nix flake check` runs deploy-rs's schema check on every node
|
||||
checks = builtins.mapAttrs
|
||||
(system: deployLib: deployLib.deployChecks self.deploy)
|
||||
deploy-rs.lib;
|
||||
};
|
||||
|
||||
perSystem = { config, pkgs, system, ... }: {
|
||||
packages = {
|
||||
ingester = pkgs.callPackage ./ingester { };
|
||||
frontend = pkgs.callPackage ./frontend { };
|
||||
};
|
||||
|
||||
devShells.default = pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
go
|
||||
gopls
|
||||
nodejs_20
|
||||
postgresql_17
|
||||
supabase-cli
|
||||
deploy-rs.packages.${system}.default
|
||||
];
|
||||
};
|
||||
|
||||
# `nix run .#dev` — full stack locally via process-compose-flake.
|
||||
# Real service wiring lives in nix/dev/process-compose.nix.
|
||||
process-compose.dev = import ./nix/dev/process-compose.nix {
|
||||
inherit pkgs;
|
||||
inherit (inputs) services-flake;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user