Skip to content

Commit

Permalink
Migrate rust-overlay patch to an overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronmondal committed Dec 3, 2024
1 parent 56dcd10 commit 4c6d33a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 28 deletions.
14 changes: 4 additions & 10 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -379,19 +379,13 @@
./tools/nixpkgs_disable_ratehammering_pulumi_tests.diff
];
};
rust-overlay-patched = (import self.inputs.nixpkgs {inherit system;}).applyPatches {
name = "rust-overlay-patched";
src = self.inputs.rust-overlay;
patches = [
# This dependency has a giant dependency chain and we don't need
# it for our usecases.
./tools/rust-overlay_cut_libsecret.diff
];
};
in
import nixpkgs-patched {
inherit system;
overlays = [(import rust-overlay-patched)];
overlays = [
(import rust-overlay)
(import ./tools/rust-overlay-cut-libsecret.nix)
];
};
apps = {
default = {
Expand Down
15 changes: 15 additions & 0 deletions tools/rust-overlay-cut-libsecret.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
final: _prev: {
rust-overlay =
final.rust-overlay
// {
mkComponent = args @ {lib, ...}:
(final.rust-overlay.mkComponent args)
// {
postFixup =
lib.replaceStrings
["patchelf --add-needed ${args.pkgsHostHost.libsecret}/lib/libsecret-1.so.0 $out/bin/cargo"]
["# patchelf --add-needed ${args.pkgsHostHost.libsecret}/lib/libsecret-1.so.0 $out/bin/cargo"]
((final.rust-overlay.mkComponent args).postFixup or "");
};
};
}
18 changes: 0 additions & 18 deletions tools/rust-overlay_cut_libsecret.diff

This file was deleted.

0 comments on commit 4c6d33a

Please sign in to comment.