9 cfg = config.services.blackfire-agent;
11 agentConfigFile = lib.generators.toINI { } {
12 blackfire = cfg.settings;
15 agentSock = "blackfire/agent.sock";
19 maintainers = pkgs.blackfire.meta.maintainers;
24 services.blackfire-agent = {
25 enable = lib.mkEnableOption "Blackfire profiler agent";
26 settings = lib.mkOption {
28 See https://blackfire.io/docs/up-and-running/configuration/agent
30 type = lib.types.submodule {
31 freeformType = with lib.types; attrsOf str;
34 server-id = lib.mkOption {
37 Sets the server id used to authenticate with Blackfire
39 You can find your personal server-id at https://blackfire.io/my/settings/credentials
43 server-token = lib.mkOption {
46 Sets the server token used to authenticate with Blackfire
48 You can find your personal server-token at https://blackfire.io/my/settings/credentials
57 config = lib.mkIf cfg.enable {
58 environment.etc."blackfire/agent".text = agentConfigFile;
60 services.blackfire-agent.settings.socket = "unix:///run/${agentSock}";