From c03d1e75a1e5e10384e2836cdd6537a4e94be89a Mon Sep 17 00:00:00 2001 From: h7x4 Date: Mon, 21 Nov 2022 23:06:46 +0100 Subject: [PATCH] zellij: switch config lang from yaml to kdl for 0.32.0 --- modules/programs/zellij.nix | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/modules/programs/zellij.nix b/modules/programs/zellij.nix index 2cfa625da..f84b62d01 100644 --- a/modules/programs/zellij.nix +++ b/modules/programs/zellij.nix @@ -33,7 +33,7 @@ in { example = literalExpression '' { theme = "custom"; - themes.custom.fg = 5; + themes.custom.fg = "#ffffff"; } ''; description = '' @@ -49,8 +49,16 @@ in { config = mkIf cfg.enable { home.packages = [ cfg.package ]; - home.file."${configDir}/config.yaml" = mkIf (cfg.settings != { }) { - source = yamlFormat.generate "zellij.yaml" cfg.settings; - }; + # Zellij switched from yaml to KDL in version 0.32.0: + # https://github.com/zellij-org/zellij/releases/tag/v0.32.0 + home.file."${configDir}/config.yaml" = mkIf + (cfg.settings != { } && (versionOlder cfg.package.version "0.32.0")) { + source = yamlFormat.generate "zellij.yaml" cfg.settings; + }; + + home.file."${configDir}/config.kdl" = mkIf + (cfg.settings != { } && (versionAtleast cfg.package.version "0.32.0")) { + text = lib.hm.generators.toKDL { } cfg.settings; + }; }; }