From 4f898f373d8b0bfdac635b036396c90b0ad17be8 Mon Sep 17 00:00:00 2001 From: awwpotato <153149335+awwpotato@users.noreply.github.com> Date: Sun, 13 Apr 2025 11:59:21 -0700 Subject: [PATCH] helix: add support for path and string themes (#6814) --- modules/programs/helix.nix | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/modules/programs/helix.nix b/modules/programs/helix.nix index ff996d33..e0befbbd 100644 --- a/modules/programs/helix.nix +++ b/modules/programs/helix.nix @@ -131,7 +131,13 @@ in }; themes = mkOption { - type = types.attrsOf tomlFormat.type; + type = types.attrsOf ( + types.oneOf [ + tomlFormat.type + types.path + types.lines + ] + ); default = { }; example = literalExpression '' { @@ -245,7 +251,13 @@ in themes = lib.mapAttrs' ( n: v: lib.nameValuePair "helix/themes/${n}.toml" { - source = tomlFormat.generate "helix-theme-${n}" v; + source = + if lib.isAttrs v then + tomlFormat.generate "helix-theme-${n}" v + else if builtins.isPath cfg.style || lib.isStorePath cfg.style then + cfg.style + else + pkgs.writeText "helix-theme-${n}" v; } ) cfg.themes; in