From 09ff165ba6ed95c85be9dba95c8d638289686fa2 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Wed, 20 May 2026 09:23:01 -0500 Subject: [PATCH] claude-code: use lib.hm.strings.isPathLike --- modules/programs/claude-code.nix | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/modules/programs/claude-code.nix b/modules/programs/claude-code.nix index 52dc1e3f6..85848846b 100644 --- a/modules/programs/claude-code.nix +++ b/modules/programs/claude-code.nix @@ -548,10 +548,6 @@ in let mkSourceEntry = content: if lib.isPath content then { source = content; } else { text = content; }; - isStorePathString = - content: builtins.isString content && lib.hasPrefix "${builtins.storeDir}/" content; - isPathLikeContent = content: lib.isPath content || isStorePathString content; - mkMarkdownEntries = subdir: attrs: lib.mapAttrs' ( @@ -579,14 +575,14 @@ in mkSkillEntry = name: content: - if isPathLikeContent content && lib.pathIsDirectory content then + if lib.hm.strings.isPathLike content && lib.pathIsDirectory content then nameValuePair "${cfg.configDir}/skills/${name}" { source = content; recursive = true; } else nameValuePair "${cfg.configDir}/skills/${name}/SKILL.md" ( - if isPathLikeContent content then { source = content; } else { text = content; } + if lib.hm.strings.isPathLike content then { source = content; } else { text = content; } ); mkMarketplaceEntry = _name: content: { @@ -628,7 +624,7 @@ in message = "`programs.claude-code.package` cannot be null when `mcpServers`, `lspServers`, `enableMcpIntegration`, or `plugins` is configured"; } { - assertion = !isPathLikeContent cfg.skills || lib.pathIsDirectory cfg.skills; + assertion = !lib.hm.strings.isPathLike cfg.skills || lib.pathIsDirectory cfg.skills; message = "`programs.claude-code.skills` must be a directory when set to a path"; } ] @@ -725,7 +721,7 @@ in (mkRecursiveDirAttrs "commands" cfg.commandsDir) (mkRecursiveDirAttrs "hooks" cfg.hooksDir) (mkRecursiveDirAttrs "rules" cfg.rulesDir) - (lib.mkIf (isPathLikeContent cfg.skills) { + (lib.mkIf (lib.hm.strings.isPathLike cfg.skills) { "${cfg.configDir}/skills" = { source = cfg.skills; recursive = true;