Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tilt: add completions #374349

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions pkgs/by-name/ti/tilt/binary.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
src,
version,
tilt-assets,
stdenv,
installShellFiles,
}:

buildGoModule rec {
(buildGoModule rec {
pname = "tilt";
/*
Do not use "dev" as a version. If you do, Tilt will consider itself
Expand All @@ -21,6 +23,8 @@ buildGoModule rec {

ldflags = [ "-X main.version=${version}" ];

nativeBuildInputs = [ installShellFiles ];

preBuild = ''
mkdir -p pkg/assets/build
cp -r ${tilt-assets}/* pkg/assets/build/
Expand All @@ -33,4 +37,14 @@ buildGoModule rec {
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ anton-dessiatov ];
};
}
}).overrideAttrs
(old: {
postInstall =
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It didn't seem like postInstall is a supported argument of buildGoModule. sorry if the way I've done this is bad form in nixpkgs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(old.postInstall or "")
+ ''
installShellCompletion --cmd tilt \
--bash <($out/bin/tilt completion bash) \
--fish <($out/bin/tilt completion fish) \
--zsh <($out/bin/tilt completion zsh)
'';
})