add poltergeist package and plugin

This commit is contained in:
Josh Palmer 2026-01-04 13:37:15 +01:00
parent 94b497f258
commit d5df36f9a6
4 changed files with 75 additions and 0 deletions

View File

@ -20,6 +20,7 @@
sonoscli = pkgs.callPackage ./nix/pkgs/sonoscli.nix {};
bird = pkgs.callPackage ./nix/pkgs/bird.nix {};
peekaboo = pkgs.callPackage ./nix/pkgs/peekaboo.nix {};
poltergeist = pkgs.callPackage ./nix/pkgs/poltergeist.nix {};
}
);
@ -30,6 +31,7 @@
sonoscli = self.packages.${system}.sonoscli;
bird = self.packages.${system}.bird;
peekaboo = self.packages.${system}.peekaboo;
poltergeist = self.packages.${system}.poltergeist;
});
};
}

37
nix/pkgs/poltergeist.nix Normal file
View File

@ -0,0 +1,37 @@
{ lib, stdenv, fetchurl, watchman }:
stdenv.mkDerivation {
pname = "poltergeist";
version = "2.1.1";
src = fetchurl {
url = "https://github.com/steipete/poltergeist/releases/download/v2.1.1/poltergeist-macos-universal-v2.1.1.tar.gz";
hash = "sha256-plQQjbB0QV7UY7U3ZdhfAZsAY/5m0G1E1WEgMm+elk8=";
};
dontConfigure = true;
dontBuild = true;
unpackPhase = ''
tar -xzf "$src"
'';
installPhase = ''
runHook preInstall
mkdir -p "$out/bin"
cp poltergeist "$out/bin/poltergeist"
cp polter "$out/bin/polter"
chmod 0755 "$out/bin/poltergeist" "$out/bin/polter"
runHook postInstall
'';
propagatedBuildInputs = [ watchman ];
meta = with lib; {
description = "Universal file watcher with auto-rebuild for any language or build system";
homepage = "https://github.com/steipete/poltergeist";
license = licenses.mit;
platforms = [ "aarch64-darwin" ];
mainProgram = "poltergeist";
};
}

View File

@ -0,0 +1,27 @@
{
description = "clawdbot plugin: poltergeist";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
root.url = "path:../..";
};
outputs = { self, nixpkgs, root }:
let
system = "aarch64-darwin";
pkgs = import nixpkgs { inherit system; };
poltergeist = root.packages.${system}.poltergeist;
in {
packages.${system}.poltergeist = poltergeist;
clawdbotPlugin = {
name = "poltergeist";
skills = [ ./skills/poltergeist ];
packages = [ poltergeist ];
needs = {
stateDirs = [];
requiredEnv = [];
};
};
};
}

View File

@ -0,0 +1,9 @@
---
name: poltergeist
description: File watcher with auto-rebuild for any language or build system.
---
Use the `poltergeist` and `polter` CLIs to watch and run builds.
Example:
- poltergeist --help