Files
dotfiles/nixos/machines/railbird-sf.nix
Ivan Malison e7a455ced9 feat(nixos): add org-agenda-api hosting with nginx + Let's Encrypt
Add NixOS module to host org-agenda-api container on railbird-sf:
- org-agenda-api-host.nix: New module with nginx reverse proxy and ACME
- nginx configured for rbsf.tplinkdns.com with automatic TLS
- Container runs on port 51847 (random high port)
- Supports nix-built container images via imageFile option

Configure railbird-sf to use the new module:
- Build org-agenda-api container from flake
- Pass container to machine config via specialArgs
- Set up agenix secret for container environment

Note: Requires creating secrets file with AUTH_PASSWORD and
GIT_SSH_PRIVATE_KEY environment variables.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 09:40:19 -08:00

89 lines
2.6 KiB
Nix

{ config, lib, pkgs, forEachUser, inputs, orgAgendaApiContainer ? null, ... }:
{
imports = [
../configuration.nix
inputs.agenix.nixosModules.default
];
networking.hostName = "railbird-sf";
# org-agenda-api hosting with nginx + Let's Encrypt
age.secrets.org-api-env = {
file = ../secrets/org-api-passwords.age;
# Readable by the podman container service
};
services.org-agenda-api-host = {
enable = true;
domain = "rbsf.tplinkdns.com";
containerImage = "colonelpanic-org-agenda-api";
containerImageFile = orgAgendaApiContainer;
secretsFile = config.age.secrets.org-api-env.path;
};
hardware.enableRedistributableFirmware = true;
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
boot.loader.systemd-boot.enable = true;
myModules.postgres.enable = true;
features.full.enable = true;
services.k3s.role = "agent";
services.k3s.extraFlags = lib.mkForce ["--node-label nixos-nvidia-cdi=enabled"];
hardware.nvidia = {
powerManagement.enable = false;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = false;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
};
myModules.base.enable = true;
myModules.desktop.enable = true;
myModules.code.enable = true;
myModules.syncthing.enable = true;
myModules.fonts.enable = true;
myModules.plasma.enable = true;
myModules.nvidia.enable = true;
myModules.gitea-runner.enable = true;
myModules.railbird-k3s = {
enable = false;
serverAddr = "https://dev.railbird.ai:6443";
};
fileSystems."/" =
{ device = "/dev/disk/by-uuid/a317d456-6f84-41ee-a149-8e466e414aae";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/B875-39D4";
fsType = "vfat";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/129345f3-e1e1-4d45-9db9-643160c6d564"; }
];
environment.systemPackages = with pkgs; [
android-studio
];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
home-manager.users = forEachUser {
home.stateVersion = "23.11";
};
system.stateVersion = "23.11";
}