From a29301179b9496f212d15a534d76d47305005843 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Sat, 16 May 2026 10:04:34 +0200 Subject: [PATCH] feat(opencode): install kepano/obsidian-skills into ~/.agents/skills Add obsidian-skills as a flake input (flake = false) and map each skill subdirectory into ~/.agents/skills/, alongside the existing local skills. Updates flow through `nix flake update obsidian-skills`. --- flake.lock | 17 +++++++++++++++ flake.nix | 5 +++++ modules/home/cli-apps/opencode/default.nix | 25 ++++++++++++++++++---- 3 files changed, 43 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 2f53f07..10c43ef 100644 --- a/flake.lock +++ b/flake.lock @@ -672,6 +672,22 @@ "type": "github" } }, + "obsidian-skills": { + "flake": false, + "locked": { + "lastModified": 1778185448, + "narHash": "sha256-2kr8fmkuxRLaTy2O+dTv9K+75mRIqkLmaArw2/hj5uc=", + "owner": "kepano", + "repo": "obsidian-skills", + "rev": "ac9398734fe719565809f7a6048b05c36b1ca38f", + "type": "github" + }, + "original": { + "owner": "kepano", + "repo": "obsidian-skills", + "type": "github" + } + }, "pre-commit-hooks-nix": { "inputs": { "flake-compat": [ @@ -714,6 +730,7 @@ "nix-homebrew": "nix-homebrew", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs_2", + "obsidian-skills": "obsidian-skills", "rust-overlay": "rust-overlay_2", "simple-nixos-mailserver": "simple-nixos-mailserver", "snowfall-lib": "snowfall-lib", diff --git a/flake.nix b/flake.nix index c752719..3f759af 100644 --- a/flake.nix +++ b/flake.nix @@ -75,6 +75,11 @@ wyoming-whisper-rs.url = "git+https://git.hoyer.xyz/harald/wyoming-whisper-rs.git?submodules=1"; wyoming-whisper-rs.inputs.nixpkgs.follows = "nixpkgs"; + + obsidian-skills = { + url = "github:kepano/obsidian-skills"; + flake = false; + }; }; outputs = diff --git a/modules/home/cli-apps/opencode/default.nix b/modules/home/cli-apps/opencode/default.nix index d5996f5..f1ca10b 100644 --- a/modules/home/cli-apps/opencode/default.nix +++ b/modules/home/cli-apps/opencode/default.nix @@ -1,6 +1,7 @@ { lib, config, + inputs, ... }: let @@ -8,6 +9,19 @@ let inherit (lib.metacfg) mkBoolOpt; cfg = config.metacfg.cli-apps.opencode; + + obsidianSkills = + lib.mapAttrs' + ( + name: _: + lib.nameValuePair ".agents/skills/${name}" { + source = "${inputs.obsidian-skills}/skills/${name}"; + recursive = true; + } + ) + ( + lib.filterAttrs (_: type: type == "directory") (builtins.readDir "${inputs.obsidian-skills}/skills") + ); in { options.metacfg.cli-apps.opencode = { @@ -20,9 +34,12 @@ in recursive = true; }; - home.file.".agents/skills" = { - source = ../../../../config/agents/skills; - recursive = true; - }; + home.file = { + ".agents/skills" = { + source = ../../../../config/agents/skills; + recursive = true; + }; + } + // obsidianSkills; }; }