Add org-agenda-api container builds and fly.io deployment
Consolidates container builds from colonelpanic-org-agenda-api repo: - Add org-agenda-api input to nixos flake - Add container-colonelpanic and container-kat package outputs - Add org-agenda-api cachix as substituter - Add org-agenda-api devShell for deployment work New org-agenda-api directory contains: - container.nix: Container build logic using mkContainer - configs/: Instance configs (custom-config.el, fly.toml, secrets) - deploy.sh: Fly.io deployment script - secrets.nix: agenix secret declarations Build with: nix build .#container-colonelpanic Deploy with: cd org-agenda-api && ./deploy.sh colonelpanic Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
43
org-agenda-api/container.nix
Normal file
43
org-agenda-api/container.nix
Normal file
@@ -0,0 +1,43 @@
|
||||
# Container build logic for org-agenda-api instances
|
||||
# Imported by the main dotfiles flake to expose container outputs
|
||||
{ pkgs, system, tangledConfig, org-agenda-api, orgApiRev, dotfilesRev }:
|
||||
|
||||
let
|
||||
# Build container for a specific instance
|
||||
mkInstanceContainer = instanceName: customConfigEl: overridesEl:
|
||||
let
|
||||
# Combine tangled config with instance-specific loader and overrides
|
||||
orgAgendaCustomConfig = pkgs.runCommand "org-agenda-custom-config-${instanceName}" {} ''
|
||||
mkdir -p $out
|
||||
|
||||
# Copy tangled files from dotfiles
|
||||
cp ${tangledConfig}/*.el $out/ 2>/dev/null || true
|
||||
|
||||
# Add instance-specific custom-config.el loader
|
||||
cp ${customConfigEl} $out/custom-config.el
|
||||
|
||||
# Add optional overrides.el if provided
|
||||
${if overridesEl != null then "cp ${overridesEl} $out/overrides.el" else ""}
|
||||
'';
|
||||
in
|
||||
org-agenda-api.lib.${system}.mkContainer {
|
||||
customElispFile = "${orgAgendaCustomConfig}/custom-config.el";
|
||||
# Use content-based tag to avoid caching issues
|
||||
tag = "${instanceName}-${orgApiRev}-${dotfilesRev}";
|
||||
};
|
||||
|
||||
configsDir = ./configs;
|
||||
in
|
||||
{
|
||||
inherit mkInstanceContainer;
|
||||
|
||||
# Pre-built instance containers
|
||||
containers = {
|
||||
colonelpanic = mkInstanceContainer "colonelpanic"
|
||||
"${configsDir}/colonelpanic/custom-config.el"
|
||||
null;
|
||||
kat = mkInstanceContainer "kat"
|
||||
"${configsDir}/kat/custom-config.el"
|
||||
null;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user