Eliminates the manual version bump in flake.nix on each release. Uses self.shortRev (or dirtyShortRev) since self.gitDescribe is not yet available in this Nix version. Makefile builds still get the full git describe output via ldflags. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
57 lines
1.5 KiB
Nix
57 lines
1.5 KiB
Nix
{
|
|
description = "mcp - Metacircular Control Plane";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
|
|
};
|
|
|
|
outputs =
|
|
{ self, nixpkgs }:
|
|
let
|
|
system = "x86_64-linux";
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
version = pkgs.lib.removePrefix "v" (self.gitDescribe or self.shortRev or self.dirtyShortRev or "unknown");
|
|
in
|
|
{
|
|
packages.${system} = {
|
|
default = pkgs.buildGoModule {
|
|
pname = "mcp";
|
|
inherit version;
|
|
src = ./.;
|
|
vendorHash = null;
|
|
subPackages = [
|
|
"cmd/mcp"
|
|
];
|
|
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/mcp completion zsh > $out/share/zsh/site-functions/_mcp
|
|
$out/bin/mcp completion bash > $out/share/bash-completion/completions/mcp
|
|
$out/bin/mcp completion fish > $out/share/fish/vendor_completions.d/mcp.fish
|
|
'';
|
|
};
|
|
|
|
mcp-agent = pkgs.buildGoModule {
|
|
pname = "mcp-agent";
|
|
inherit version;
|
|
src = ./.;
|
|
vendorHash = null;
|
|
subPackages = [
|
|
"cmd/mcp-agent"
|
|
];
|
|
ldflags = [
|
|
"-s"
|
|
"-w"
|
|
"-X main.version=${version}"
|
|
];
|
|
};
|
|
};
|
|
};
|
|
}
|