Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 77 lines 2.3 kB view raw
1{ 2 lib, 3 fetchFromGitHub, 4 elk7Version, 5 buildGoModule, 6 libpcap, 7 nixosTests, 8 systemd, 9 config, 10}: 11 12let 13 beat = 14 package: extraArgs: 15 buildGoModule ( 16 lib.attrsets.recursiveUpdate (rec { 17 pname = package; 18 version = elk7Version; 19 20 src = fetchFromGitHub { 21 owner = "elastic"; 22 repo = "beats"; 23 rev = "v${version}"; 24 hash = "sha256-TzcKB1hIHe1LNZ59GcvR527yvYqPKNXPIhpWH2vyMTY="; 25 }; 26 27 vendorHash = "sha256-JOCcceYYutC5MI+/lXBqcqiET+mcrG1e3kWySo3+NIk="; 28 29 subPackages = [ package ]; 30 31 meta = with lib; { 32 homepage = "https://www.elastic.co/products/beats"; 33 license = licenses.asl20; 34 maintainers = with maintainers; [ 35 fadenb 36 basvandijk 37 dfithian 38 ]; 39 platforms = platforms.linux; 40 }; 41 }) extraArgs 42 ); 43in 44rec { 45 auditbeat7 = beat "auditbeat" { meta.description = "Lightweight shipper for audit data"; }; 46 filebeat7 = beat "filebeat" { 47 meta.description = "Lightweight shipper for logfiles"; 48 buildInputs = [ systemd ]; 49 tags = [ "withjournald" ]; 50 postFixup = '' 51 patchelf --set-rpath ${lib.makeLibraryPath [ (lib.getLib systemd) ]} "$out/bin/filebeat" 52 ''; 53 }; 54 heartbeat7 = beat "heartbeat" { meta.description = "Lightweight shipper for uptime monitoring"; }; 55 metricbeat7 = beat "metricbeat" { 56 meta.description = "Lightweight shipper for metrics"; 57 passthru.tests = lib.optionalAttrs config.allowUnfree ( 58 assert metricbeat7.drvPath == nixosTests.elk.unfree.ELK-7.elkPackages.metricbeat.drvPath; 59 { 60 elk = nixosTests.elk.unfree.ELK-7; 61 } 62 ); 63 }; 64 packetbeat7 = beat "packetbeat" { 65 buildInputs = [ libpcap ]; 66 meta.description = "Network packet analyzer that ships data to Elasticsearch"; 67 meta.longDescription = '' 68 Packetbeat is an open source network packet analyzer that ships the 69 data to Elasticsearch. 70 71 Think of it like a distributed real-time Wireshark with a lot more 72 analytics features. The Packetbeat shippers sniff the traffic between 73 your application processes, parse on the fly protocols like HTTP, MySQL, 74 PostgreSQL, Redis or Thrift and correlate the messages into transactions. 75 ''; 76 }; 77}