wire tide service into nixos config

Imports the tide nixos module from the TIDE flake and configures
it for tide.yisroelbaum.com (frontend) and apitide.yisroelbaum.com
(backend), reusing the existing wildcard ACME cert. Secrets are
pulled from sops-encrypted secrets/tide.yaml; replace the
placeholder with real encrypted content before deploy.
This commit is contained in:
Yisroel Baum 2026-05-08 10:56:13 +03:00
parent b7716061e4
commit d195c6b37c
4 changed files with 75 additions and 0 deletions

29
tide.nix Normal file
View file

@ -0,0 +1,29 @@
{
domainName,
...
}:
{
services.tide = {
enable = true;
domain = "tide.${domainName}";
apiDomain = "apitide.${domainName}";
secretsFile = "/run/secrets/tide-env";
# Reuse the wildcard cert already issued for *.${domainName}
# in configuration.nix instead of requesting a new one per
# subdomain.
nginx.useACMEHost = domainName;
};
# Don't fail evaluation when secrets/tide.yaml is missing (e.g.
# before the operator has encrypted it on a fresh checkout).
# sops-install-secrets will still error at activation time if
# the file is absent, which is the right place for that failure.
sops.validateSopsFiles = false;
sops.secrets."tide-env" = {
sopsFile = ./secrets/tide.yaml;
# phpfpm reads this via EnvironmentFile, which runs as root
# before dropping to the tide user, so root readable is enough.
mode = "0400";
};
}