summary refs log tree commit diff
path: root/pkgs/tools/misc
diff options
context:
space:
mode:
authorAustin Seipp <aseipp@pobox.com>2020-11-09 23:52:12 -0600
committerGitHub <noreply@github.com>2020-11-09 23:52:12 -0600
commitdd1b7e377f6d77ddee4ab84be11173d3566d6a18 (patch)
treec2c79c43629d507e77ebfdf76d30a3752880560b /pkgs/tools/misc
parentea4169b5c3ecbf7731e2dad22431ca71d0b365c2 (diff)
parenta03c8a8f35613b4ca501d09c788545d1fd7376ec (diff)
Merge pull request #101778 from johanot/vector-more-default-features
vector: add sinks, sources and transforms as nixpkgs default features
Diffstat (limited to 'pkgs/tools/misc')
-rw-r--r--pkgs/tools/misc/vector/default.nix15
1 files changed, 14 insertions, 1 deletions
diff --git a/pkgs/tools/misc/vector/default.nix b/pkgs/tools/misc/vector/default.nix
index 37595702b6864..701e86dbf9018 100644
--- a/pkgs/tools/misc/vector/default.nix
+++ b/pkgs/tools/misc/vector/default.nix
@@ -4,9 +4,11 @@
 , tzdata
 
 , features ?
-    (if stdenv.isAarch64
+    ((if stdenv.isAarch64
      then [ "jemallocator" "rdkafka" "rdkafka/dynamic_linking" ]
      else [ "leveldb" "leveldb/leveldb-sys-2" "jemallocator" "rdkafka" "rdkafka/dynamic_linking" ])
+     ++
+     [ "sinks" "sources" "transforms" ])
 , coreutils
 , CoreServices
 }:
@@ -38,9 +40,20 @@ rustPlatform.buildRustPackage rec {
   # vector.dev during the checkPhase, which obviously isn't going to work.
   # these tests in the DNS module are trivial though, so stubbing them out is
   # fine IMO.
+  #
+  # the geoip transform yields maxmindb.so which contains references to rustc.
+  # neither figured out why the shared object is included in the output
+  # (it doesn't seem to be a runtime dependencies of the geoip transform),
+  # nor do I know why it depends on rustc.
+  # However, in order for the closure size to stay at a reasonable level,
+  # transforms-geoip is patched out of Cargo.toml for now - unless explicitly asked for.
   patchPhase = ''
     substituteInPlace ./src/dns.rs \
       --replace "#[test]" ""
+
+    ${lib.optionalString (!builtins.elem "transforms-geoip" features) ''
+        substituteInPlace ./Cargo.toml --replace '"transforms-geoip",' ""
+    ''}
   '';
 
   meta = with stdenv.lib; {