From fcd692ed4a67f479151c74721adf2670c6143030 Mon Sep 17 00:00:00 2001 From: Maxime Brunet Date: Mon, 1 Apr 2024 12:44:28 -0700 Subject: [PATCH] mutagen: add shell completions --- pkgs/tools/misc/mutagen/default.nix | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/misc/mutagen/default.nix b/pkgs/tools/misc/mutagen/default.nix index 5cfdff54a708..f759620d63fd 100644 --- a/pkgs/tools/misc/mutagen/default.nix +++ b/pkgs/tools/misc/mutagen/default.nix @@ -1,4 +1,4 @@ -{ lib, buildGoModule, fetchFromGitHub, fetchzip }: +{ lib, buildGoModule, fetchFromGitHub, fetchzip, installShellFiles }: buildGoModule rec { pname = "mutagen"; @@ -24,6 +24,8 @@ buildGoModule rec { hash = "sha256-RFB1/gzLjs9w8mebEd4M9Ldv3BrLIj2RsN/QAIJi45E="; }; + nativeBuildInputs = [ installShellFiles ]; + doCheck = false; subPackages = [ "cmd/mutagen" "cmd/mutagen-agent" ]; @@ -33,6 +35,17 @@ buildGoModule rec { postInstall = '' install -d $out/libexec ln -s ${agents}/mutagen-agents.tar.gz $out/libexec/ + + $out/bin/mutagen generate \ + --bash-completion-script mutagen.bash \ + --fish-completion-script mutagen.fish \ + --zsh-completion-script mutagen.zsh + + installShellCompletion \ + --cmd mutagen \ + --bash mutagen.bash \ + --fish mutagen.fish \ + --zsh mutagen.zsh ''; meta = with lib; {