From 0b8c607be7248e16619d8e9b01b814ef9ec38aee Mon Sep 17 00:00:00 2001 From: NAHO <90870942+trueNAHO@users.noreply.github.com> Date: Sat, 21 Oct 2023 16:54:17 +0200 Subject: [PATCH] feat(modules/programs/eww): make 'configDir' setting optional Manually configuring 'eww' with 'xdg.configFile."eww".text' in order to leverage Nix' capabilities, is inconvenient due to the required 'xdg.configFile."eww".source' symlink. This change makes the symlink optional. --- modules/programs/eww.nix | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/modules/programs/eww.nix b/modules/programs/eww.nix index 3d178f942..6eba60bcc 100644 --- a/modules/programs/eww.nix +++ b/modules/programs/eww.nix @@ -23,7 +23,8 @@ in { }; configDir = mkOption { - type = types.path; + type = types.nullOr types.path; + default = null; example = literalExpression "./eww-config-dir"; description = '' The directory that gets symlinked to @@ -32,8 +33,11 @@ in { }; }; - config = mkIf cfg.enable { - home.packages = [ cfg.package ]; - xdg.configFile."eww".source = cfg.configDir; - }; + config = mkIf cfg.enable (mkMerge [ + { home.packages = [ cfg.package ]; } + + (mkIf (cfg.configDir != null) { + xdg.configFile."eww".source = cfg.configDir; + }) + ]); }