diff options
author | Katharina Fey <kookie@spacekookie.de> | 2020-02-03 10:05:30 +0100 |
---|---|---|
committer | Katharina Fey <kookie@spacekookie.de> | 2020-02-03 10:05:30 +0100 |
commit | c488527c95c874d3b8743c915173ad7bfb05d5af (patch) | |
tree | 2b874dc5606a9dff44096a5e8557f00dc52ac2b6 /home-manager/modules/programs/taskwarrior.nix | |
parent | 899a451e08f7d6d2c8214d119c2a0316849a0ed4 (diff) | |
parent | 6cc4fd6ede4909226cb81d3475834251ed1b7210 (diff) |
Merge commit '6cc4fd6ede4909226cb81d3475834251ed1b7210'
Diffstat (limited to 'home-manager/modules/programs/taskwarrior.nix')
-rw-r--r-- | home-manager/modules/programs/taskwarrior.nix | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/home-manager/modules/programs/taskwarrior.nix b/home-manager/modules/programs/taskwarrior.nix index eeacc77da29..cf95511f8ef 100644 --- a/home-manager/modules/programs/taskwarrior.nix +++ b/home-manager/modules/programs/taskwarrior.nix @@ -9,38 +9,39 @@ let themePath = theme: "${pkgs.taskwarrior}/share/doc/task/rc/${theme}.theme"; includeTheme = location: - if location == null then "" - else if isString location then "include ${themePath location}" - else "include ${location}"; + if location == null then + "" + else if isString location then + "include ${themePath location}" + else + "include ${location}"; formatValue = value: - if isBool value then if value then "true" else "false" - else if isList value then concatMapStringsSep "," formatValue value - else toString value; + if isBool value then + if value then "true" else "false" + else if isList value then + concatMapStringsSep "," formatValue value + else + toString value; - formatLine = key: value: - "${key}=${formatValue value}"; + formatLine = key: value: "${key}=${formatValue value}"; formatSet = key: values: (concatStringsSep "\n" - (mapAttrsToList - (subKey: subValue: formatPair "${key}.${subKey}" subValue) + (mapAttrsToList (subKey: subValue: formatPair "${key}.${subKey}" subValue) values)); formatPair = key: value: - if isAttrs value then formatSet key value - else formatLine key value; + if isAttrs value then formatSet key value else formatLine key value; -in - -{ +in { options = { programs.taskwarrior = { enable = mkEnableOption "Task Warrior"; config = mkOption { type = types.attrs; - default = {}; + default = { }; example = literalExample '' { confirmation = false; @@ -103,8 +104,7 @@ in data.location=${cfg.dataLocation} ${includeTheme cfg.colorTheme} - ${concatStringsSep "\n" ( - mapAttrsToList formatPair cfg.config)} + ${concatStringsSep "\n" (mapAttrsToList formatPair cfg.config)} ${cfg.extraConfig} ''; |