Something went wrong. Try again.
Something went wrong. Try again.
claude-plugins flake.nix
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155{ description = "Personal Claude Code plugins and skills by Juan C. Müller";
inputs = { ci-tool = { url = "sourcehut:~jcmuller/ci-tool"; inputs = { ci-tool.follows = "ci-tool"; flake-parts.follows = "flake-parts"; modules.follows = "modules"; nixpkgs.follows = "nixpkgs"; }; };
git-hooks-nix = { url = "github:cachix/git-hooks.nix"; inputs.nixpkgs.follows = "nixpkgs"; };
flake-parts.url = "github:hercules-ci/flake-parts";
modules = { url = "sourcehut:~jcmuller/modules";
inputs = { ci-tool.follows = "ci-tool"; flake-parts.follows = "flake-parts"; modules.follows = "modules"; nixpkgs.follows = "nixpkgs"; }; };
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; };
outputs = inputs @ {flake-parts, ...}: flake-parts.lib.mkFlake {inherit inputs;} { imports = [ inputs.git-hooks-nix.flakeModule inputs.modules.flakeModules.claude-marketplace inputs.modules.flakeModules.golang ];
systems = [ "aarch64-darwin" "aarch64-linux" "x86_64-darwin" "x86_64-linux" ];
perSystem = { config, pkgs, ... }: { packages.default = pkgs.callPackage ./. {inherit pkgs;};
pre-commit.settings.hooks.commitizen.enable = true;
modules.scripts = { generate = { category = "Project management"; description = "Generate marketplace.json and plugin.json from plugins.yaml";
exec = # sh '' go run ./cmd/generate ''; };
ci-build-artifacts-sha256 = { category = "CI"; description = "CI: generate SHA256 checksums for release artifacts"; hidden = true;
exec = # sh '' set -euo pipefail shopt -s nullglob for artifact in /tmp/build-artifacts/*; do [[ "$artifact" == *.sha256 ]] && continue sha256sum "$artifact" | awk '{print $1}' > "''${artifact}.sha256" done ''; };
ci-release-hook-generate = { category = "CI"; description = "CI: regenerate manifests and stamp PLUGIN_VERSION into wrapper scripts"; hidden = true;
exec = # sh '' set -euo pipefail VERSION="$1" go run ./cmd/generate for script in plugins/*/scripts/*.sh; do if grep -q '^PLUGIN_VERSION=' "$script"; then sed -i "s|^PLUGIN_VERSION=.*|PLUGIN_VERSION=\"v''${VERSION}\"|" "$script" git add "$script" fi done git add .claude-plugin/marketplace.json git add plugins/*/.claude-plugin/plugin.json ''; };
ci-test-bats = { category = "CI"; description = "CI: run bats tests for plugins"; hidden = true;
exec = # sh '' shopt -s nullglob files=(plugins/*/tests/*.bats) shopt -u nullglob
if [[ ''${#files[@]} -eq 0 ]]; then echo "No bats tests found" exit 0 fi
echo "Running ''${#files[@]} bats test file(s)" bats "''${files[@]}" ''; }; };
devShells.default = pkgs.mkShell { inputsFrom = [ config.modules.claude-marketplace config.modules.golang config.pre-commit.devShell ];
buildInputs = with pkgs; [ go_1_26 bats ];
shellHook = # sh '' export CGO_ENABLED=0 ''; }; }; };}