{ 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 ''; }; }; }; }