From eebc44e609cc2f901c7ea694d62e36f63cbeae24 Mon Sep 17 00:00:00 2001 From: Justin Bedo Date: Mon, 20 Dec 2021 14:38:24 +1100 Subject: rewrite strip store paths Old version used sed, which is not inplace and causes issues when garbage collection triggers during a build. This patch adds a small rewriter that works in place. --- strip-store-paths/default.nix | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 strip-store-paths/default.nix (limited to 'strip-store-paths/default.nix') diff --git a/strip-store-paths/default.nix b/strip-store-paths/default.nix new file mode 100644 index 0000000..40fb546 --- /dev/null +++ b/strip-store-paths/default.nix @@ -0,0 +1,20 @@ +{ stdenv, zig }: + +stdenv.mkDerivation { + name = "strip-store-paths"; + nativeBuildInputs = [ zig ]; + src = ./strip-store-paths.zig; + + unpackPhase = '' + cp $src strip-store-paths.zig + ''; + + buildPhase = '' + export HOME=$TMPDIR + zig build-exe -OReleaseFast strip-store-paths.zig + ''; + + installPhase = '' + install -Dm 755 ./strip-store-paths $out/bin/strip-store-paths + ''; +} -- cgit v1.2.3