Skip to content

Shell Completion through postInstall Hook #668

Closed Answered by ipetkov
rsrohitsingh682 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @rsrohitsingh682, normally when you call buildPackage without specifying cargoArtifacts all attributes will be applied to the deps-only and the final derivations. Since you want the install hook to only run on the final derivation, you'll need to explicitly call buildDepsOnly with the install hook omitted:

let
  commonArgs = {
    # everything except for `postInstall`
  };
  cargoArtifacts = craneLib.buildDepsOnly commonArgs;
in
craneLib.buildPackage (commonArgs // {
  inherit cargoArtifacts;
  postInstal = ''
    # etc ...
  '';
})

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ipetkov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants