From f658c7e1fe81480be22b2c7a0f6b57c0ebb6f943 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Tue, 21 Mar 2023 18:45:34 -0600 Subject: [PATCH] flake.nix: Minimize the closure size of attic-static --- flake.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/flake.nix b/flake.nix index bfe0e2b..4ecc1ef 100644 --- a/flake.nix +++ b/flake.nix @@ -59,11 +59,20 @@ ]; }); }).overrideAttrs (old: { + nativeBuildInputs = (old.nativeBuildInputs or []) ++ [ + pkgs.nukeReferences + ]; + # Read by pkg_config crate (do some autodetection in build.rs?) PKG_CONFIG_ALL_STATIC = "1"; "NIX_CFLAGS_LINK_${pkgs.pkgsStatic.stdenv.cc.suffixSalt}" = "-lc"; RUSTFLAGS = "-C relocation-model=static"; + + postFixup = (old.postFixup or "") + '' + rm -f $out/nix-support/propagated-build-inputs + nuke-refs $out/bin/attic + ''; }); attic-client-static = packages.attic-static.override {