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.
This commit is contained in:
NAHO 2023-10-21 16:54:17 +02:00
parent ae631b0b20
commit 0b8c607be7
No known key found for this signature in database
GPG key ID: 1D2207B4D979BE3E

View file

@ -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;
})
]);
}