I have read how to add an overlay for rustBuildPackage
, however I am struggling to change github source of rust-analyzer.
overlays = [ (import rust-overlay) (final: prev: {
rust-analyzer-unwrapped = prev.rust-analyzer-unwrapped.overrideAttrs (old: rec {
src = prev.fetchFromGitHub {
owner = "tomasol";
repo = "rust-analyzer";
rev = "ab849d87a1ef4a48a5ad121f1059a0b7a15af485";
sha256 = "sha256-KhukRUCbveChS1SNRs3N+DGOchTv+Ch+eVlxbJIc/rw=";
};
cargoDeps = old.cargoDeps.overrideAttrs (pkgs.lib.const {
name = "rust-analyzer-unwrapped-vendor.tar.gz";
inherit src;
outputHash = "sha256-ItyXdLHrpgEMz1BHQk49w37D8Y15L7vg0jyWurrIZLs=";
});
});
cargo-component = prev.cargo-component.overrideAttrs (old: rec {
version = "0.5.0";
src = prev.fetchFromGitHub {
owner = "bytecodealliance";
repo = "cargo-component";
rev = "v0.5.0";
sha256 = "sha256-P7gXfACPK63f38KzV6UVQa8MZmxEaMNxl1GZYCDM54M=";
};
cargoDeps = old.cargoDeps.overrideAttrs (pkgs.lib.const {
inherit src;
outputHash = "sha256-JEkupF7RhHqnxbA3DdJKGGznTzoAsPIcvYGjOfqdP4M=";
});
});
})
];
The issue: I see that nix is downloading the right revision, but I am convinced it builds something else. rust-analyzer --version
returns rust-analyzer 2024-01-01
, which is the current version in unstable. I have added string fork!
to the version in my fork.
How can I see the actual build steps, like
- downloading form url …
- unpacking to folder …
- executing build with arguments …
- moving binaries from … to …
?
Note that cargo-component
below works as expected, and they both seem to be set up very similarly. default.nix for rust-analyzer , cargo-component
Full source of my flake.nix