-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
83 lines (73 loc) · 3.5 KB
/
Copy pathflake.nix
File metadata and controls
83 lines (73 loc) · 3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
{
description = "Flake for Holochain app development";
inputs = {
holonix.url = "github:holochain/holonix?ref=main-0.6";
nixpkgs.follows = "holonix/nixpkgs";
flake-parts.follows = "holonix/flake-parts";
# Agent skills — consumed as plain source trees (flake = false), even where
# upstream ships its own flake.
# Pin: set url to "github:owner/repo/vX.Y.Z"
# Update to latest: nix flake update holochain-agent-skill
# The upstream repo was renamed to holochain-agent-skills (plural) at
# v1.0.0-rc.1. The input attribute stays singular so the update command above
# and the references in CONTRIBUTING.md / pai/README.md keep working.
holochain-agent-skill = {
url = "github:Soushi888/holochain-agent-skills/v1.0.0-rc.1";
flake = false;
};
};
outputs = inputs@{ flake-parts, ... }: flake-parts.lib.mkFlake { inherit inputs; } {
systems = builtins.attrNames inputs.holonix.devShells;
perSystem = { inputs', pkgs, ... }:
let
cursorPAI = (pkgs.callPackage ./nix/cursor-pai.nix { }) { paiDir = ./pai; docsDir = ./documentation; };
agentSkillsHook = pkgs.callPackage ./nix/agent-skills.nix { };
in
{
formatter = pkgs.nixpkgs-fmt;
devShells.default = pkgs.mkShell {
inputsFrom = [ inputs'.holonix.devShells.default ];
packages = (with pkgs; [
nodejs_22
binaryen
bun
# Required for `holochain` test_utils native compilation (datachannel-sys bindgen)
llvmPackages_19.libclang
cmake
pkg-config
rsync
]);
shellHook = ''
export PS1='\[\033[1;34m\][holonix:\w]\$\[\033[0m\] '
export LIBCLANG_PATH="${pkgs.llvmPackages_19.libclang.lib}/lib"
export BINDGEN_EXTRA_CLANG_ARGS="-isystem ${pkgs.llvmPackages_19.libclang.lib}/lib/clang/19/include -isystem ${pkgs.glibc.dev}/include"
git submodule update --init vendor/hrea 2>/dev/null || true
# Materialize .claude/ from pai/claude/
mkdir -p .claude/skills
rsync -a --delete ${./pai/claude}/ .claude/
# Nix store paths are read-only, and `rsync -a` preserves that mode on
# the copy. Without this the NEXT write into .claude/ fails — the skills
# hook below cannot mkdir .claude/skills/holochain, which is the
# "Permission denied (13)" rsync error seen on every CI run and in every
# local nix shell. Same treatment .cursor/ already gets.
chmod -R u+w .claude 2>/dev/null || true
chmod u+x .claude/hooks/*.hook.ts 2>/dev/null || true
# Materialize Cursor rules from pai/
mkdir -p .cursor/rules
rsync -a --delete ${cursorPAI}/ .cursor/rules/
chmod -R u+w .cursor 2>/dev/null || true
# Materialize agent skills into .claude/, .cursor/, and .agents/
mkdir -p .cursor/skills .agents/skills
${agentSkillsHook [
# Since v1.0.0-rc.1 the skill lives under skills/<name>/ rather than at
# the repo root, so the whole workshop (book.toml, docs/, .github/)
# no longer lands inside the installed skill.
{ src = "${inputs.holochain-agent-skill}/skills/holochain"; name = "holochain"; }
{ src = "${./pai/claude}/skills/nondominium-domain"; name = "nondominium-domain"; }
{ src = "${./pai/claude}/skills/complexity-oriented-programming"; name = "complexity-oriented-programming"; }
]}
'';
};
};
};
}