Adds shell completion support (zsh, bash, fish) via cobra's built-in completion command. All existing behavior and security measures are preserved. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
43 lines
1.2 KiB
Nix
43 lines
1.2 KiB
Nix
{
|
|
description = "mcias - Metacircular Identity and Access Service";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
};
|
|
|
|
outputs =
|
|
{ self, nixpkgs }:
|
|
let
|
|
system = "x86_64-linux";
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
version = "1.8.0";
|
|
in
|
|
{
|
|
packages.${system} = {
|
|
default = pkgs.buildGoModule {
|
|
pname = "mciasctl";
|
|
inherit version;
|
|
src = ./.;
|
|
vendorHash = null;
|
|
subPackages = [
|
|
"cmd/mciasctl"
|
|
"cmd/mciasgrpcctl"
|
|
];
|
|
ldflags = [
|
|
"-s"
|
|
"-w"
|
|
"-X main.version=${version}"
|
|
];
|
|
postInstall = ''
|
|
mkdir -p $out/share/zsh/site-functions
|
|
mkdir -p $out/share/bash-completion/completions
|
|
mkdir -p $out/share/fish/vendor_completions.d
|
|
$out/bin/mciasctl completion zsh > $out/share/zsh/site-functions/_mciasctl
|
|
$out/bin/mciasctl completion bash > $out/share/bash-completion/completions/mciasctl
|
|
$out/bin/mciasctl completion fish > $out/share/fish/vendor_completions.d/mciasctl.fish
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
}
|