Archived
hosts/server/host.nix and hosts/nix-cache/host.nix each hand-rolled the
same sops secret/template/environmentFile wiring for the beszel agent
token, differing only in the sops file path and template name. Factor
it into modules/beszel/host-token.nix ({ name, sopsFile }) so a third
host can adopt it without copy-pasting the boilerplate again. Also
drops two dead, stale commented-out HUB_URL lines left over from
before variables.nix grew a homeDomain var.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01La55Nsss8jZ7ZuzUV9mfot
12 lines
294 B
Nix
12 lines
294 B
Nix
{ name, sopsFile }:
|
|
|
|
{ config, ... }:
|
|
|
|
{
|
|
sops.secrets."beszel-token".sopsFile = sopsFile;
|
|
sops.templates."${name}-beszel.env".content = ''
|
|
TOKEN=${config.sops.placeholder."beszel-token"}
|
|
'';
|
|
services.beszel.agent.environmentFile = config.sops.templates."${name}-beszel.env".path;
|
|
}
|