feat: skm, pin agent skills from git repos via Nix

CLI (add, remove, list, outdated, update, import) over a skills.json manifest and a skills.lock.json pinned with nix flake prefetch, plus a home-manager module that links each locked skill via builtins.fetchTree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
johannesandClaude Opus 5.5 committed 2026-10-23 14:04:50 +02:00
commit 65a96ada8e
26 files changed
+2843

No files matched your search

+60
View File
@@ -0,0 +1,60 @@
{
description = "skm: pin and update agent skills from git repos";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs =
{ self, nixpkgs }:
let
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system});
in
{
homeModules.default = import ./nix/module.nix self;
packages = forAllSystems (pkgs: {
skm = pkgs.buildGoModule {
pname = "skm";
version = "0.1.0";
# Only the Go sources: path: inputs copy untracked dirs like .devenv too.
src = pkgs.lib.fileset.toSource {
root = ./.;
fileset = pkgs.lib.fileset.unions [
./go.mod
./cmd
./internal
];
};
vendorHash = null;
# Tests that need nix skip themselves: it isn't on PATH in the sandbox.
nativeCheckInputs = [ pkgs.git ];
nativeBuildInputs = [ pkgs.makeWrapper ];
# nix itself comes from the system, so it matches the daemon.
postInstall = ''
wrapProgram $out/bin/skm --prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.diffutils ]}
'';
meta.mainProgram = "skm";
};
default = self.packages.${pkgs.stdenv.hostPlatform.system}.skm;
});
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
packages = with pkgs; [
go
gopls
git
];
};
});
checks = forAllSystems (pkgs: {
skm = self.packages.${pkgs.stdenv.hostPlatform.system}.skm;
});
};
}