a291c8690a
GitOrigin-RevId: e6e19f3d81a982a62e1bba08f0b4f7fdc21b4ea0
26 lines
847 B
Nix
26 lines
847 B
Nix
# Configures journaldriver to forward to the tvl-fyi GCP project from
|
|
# TVL machines.
|
|
{ config, depot, lib, pkgs, ... }:
|
|
|
|
{
|
|
imports = [
|
|
(depot.third_party.agenix.src + "/modules/age.nix")
|
|
];
|
|
|
|
age.secrets.journaldriver.file = depot.ops.secrets."journaldriver.age";
|
|
|
|
services.journaldriver = {
|
|
enable = true;
|
|
googleCloudProject = "tvl-fyi";
|
|
logStream = config.networking.hostName;
|
|
};
|
|
|
|
# Override the systemd service defined in the nixpkgs module to use
|
|
# the credentials provided by agenix.
|
|
systemd.services.journaldriver = {
|
|
serviceConfig = {
|
|
LoadCredential = "journaldriver.json:/run/agenix/journaldriver";
|
|
ExecStart = lib.mkForce "${pkgs.coreutils}/bin/env GOOGLE_APPLICATION_CREDENTIALS=\"\${CREDENTIALS_DIRECTORY}/journaldriver.json\" ${depot.ops.journaldriver}/bin/journaldriver";
|
|
};
|
|
};
|
|
}
|