1 { config, lib, pkgs, ... }:
4 cfg = config.services.blackfire-agent;
6 agentConfigFile = lib.generators.toINI {} {
7 blackfire = cfg.settings;
10 agentSock = "blackfire/agent.sock";
13 maintainers = pkgs.blackfire.meta.maintainers;
18 services.blackfire-agent = {
19 enable = lib.mkEnableOption (lib.mdDoc "Blackfire profiler agent");
20 settings = lib.mkOption {
21 description = lib.mdDoc ''
22 See https://blackfire.io/docs/up-and-running/configuration/agent
24 type = lib.types.submodule {
25 freeformType = with lib.types; attrsOf str;
28 server-id = lib.mkOption {
30 description = lib.mdDoc ''
31 Sets the server id used to authenticate with Blackfire
33 You can find your personal server-id at https://blackfire.io/my/settings/credentials
37 server-token = lib.mkOption {
39 description = lib.mdDoc ''
40 Sets the server token used to authenticate with Blackfire
42 You can find your personal server-token at https://blackfire.io/my/settings/credentials
51 config = lib.mkIf cfg.enable {
52 environment.etc."blackfire/agent".text = agentConfigFile;
54 services.blackfire-agent.settings.socket = "unix:///run/${agentSock}";