DavSanchez / Nix-Relic

A collection of some infra O11y tools from New Relic packaged with Nix Flakes and accompanied by modules.
11 stars 3 forks source link

Clearer Readme for Nixos Newbies #18

Open CrystalKeck27 opened 1 day ago

CrystalKeck27 commented 1 day ago

I think that this is probably obvious to people who use nixos more often, but it tripped me up for a good couple hours.

If you want to use the newrelic-infra service, there is another step on top of the overlay.

{
  pkgs,
  lib,
  inputs,
  ...
}: {

  imports =
    [
      inputs.nix-relic.nixosModules.newrelic-infra
    ];

  nixpkgs = {
    overlays = [
      inputs.nix-relic.overlays.additions
    ];
  };

  services.newrelic-infra = {
    enable = true;
    configFile = ./newrelic-infra.yml;
  };
}

I just include this file in my flake.

It would be nice if the readme had the imports statement somewhere in it too, but even if this change isn't made. I hope this issue helps anyone struggling with this in the future.

Don't forget to specialArgs = { inherit inputs; } in your flake.nix too.

DavSanchez commented 1 day ago

Hi!

You're totally right, sorry! I'll fix the documentation.

BTW, infrastructure-agent is upstreamed to Nixpkgs, so chances are you can skip the overlay and use it directly! It's both in 24.11 and unstable.