From c321a1c8a7ef15fce4314c247ba8ff9c5408d85d Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Wed, 20 May 2026 09:23:08 -0500 Subject: [PATCH] opencode: use lib.hm.strings.isPathLike --- modules/programs/opencode.nix | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/modules/programs/opencode.nix b/modules/programs/opencode.nix index ebe4e4df6..0461f3743 100644 --- a/modules/programs/opencode.nix +++ b/modules/programs/opencode.nix @@ -63,9 +63,6 @@ let else cfg.package; - isStorePathString = - content: builtins.isString content && lib.hasPrefix "${builtins.storeDir}/" content; - isPathLikeContent = content: lib.isPath content || isStorePathString content; in { meta.maintainers = with lib.maintainers; [ delafthi ]; @@ -435,7 +432,7 @@ in message = "`programs.opencode.tools` must be a directory when set to a path"; } { - assertion = !isPathLikeContent cfg.skills || lib.pathIsDirectory cfg.skills; + assertion = !lib.hm.strings.isPathLike cfg.skills || lib.pathIsDirectory cfg.skills; message = "`programs.opencode.skills` must be a directory when set to a path"; } { @@ -522,7 +519,7 @@ in recursive = true; }; - "opencode/skills" = mkIf (isPathLikeContent cfg.skills) { + "opencode/skills" = mkIf (lib.hm.strings.isPathLike cfg.skills) { source = cfg.skills; recursive = true; }; @@ -558,14 +555,14 @@ in ) // lib.mapAttrs' ( name: content: - if isPathLikeContent content && lib.pathIsDirectory content then + if lib.hm.strings.isPathLike content && lib.pathIsDirectory content then lib.nameValuePair "opencode/skills/${name}" { source = content; recursive = true; } else lib.nameValuePair "opencode/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; } ) ) (if builtins.isAttrs cfg.skills then cfg.skills else { }) // lib.optionalAttrs (builtins.isAttrs cfg.themes) (