From 96cf8b4a05fb23a53c027621b1147b5cf9e5439f Mon Sep 17 00:00:00 2001 From: Ben Brown Date: Tue, 8 Oct 2024 18:10:14 +0100 Subject: [PATCH] feat(home-manager): add support for aerc (#338) --- .sources/sources.json | 12 ++++++++++++ modules/home-manager/aerc.nix | 23 +++++++++++++++++++++++ modules/home-manager/all-modules.nix | 1 + tests/home.nix | 1 + 4 files changed, 37 insertions(+) create mode 100644 modules/home-manager/aerc.nix diff --git a/.sources/sources.json b/.sources/sources.json index 89ab9547..4ce9e032 100644 --- a/.sources/sources.json +++ b/.sources/sources.json @@ -1,5 +1,17 @@ { "pins": { + "aerc": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "catppuccin", + "repo": "aerc" + }, + "branch": "main", + "revision": "ca404a9f2d125ef12db40db663d43c9d94116a05", + "url": "https://github.com/catppuccin/aerc/archive/ca404a9f2d125ef12db40db663d43c9d94116a05.tar.gz", + "hash": "0q9a818rwsqx5kvln5zzfan54xaw9yqbbm5hjbrwzdl5q8g28qir" + }, "alacritty": { "type": "Git", "repository": { diff --git a/modules/home-manager/aerc.nix b/modules/home-manager/aerc.nix new file mode 100644 index 00000000..4e90e279 --- /dev/null +++ b/modules/home-manager/aerc.nix @@ -0,0 +1,23 @@ +{ config, lib, ... }: +let + inherit (config.catppuccin) sources; + cfg = config.programs.aerc.catppuccin; + enable = cfg.enable && config.programs.aerc.enable; + themeName = "catppuccin-${cfg.flavor}"; +in +{ + options.programs.aerc.catppuccin = lib.ctp.mkCatppuccinOpt { name = "aerc"; }; + + config = lib.mkIf enable { + programs.aerc = { + stylesets.${themeName} = builtins.readFile "${sources.aerc}/dist/${themeName}"; + extraConfig = { + ui = { + styleset-name = themeName; + border-char-vertical = "│"; + border-char-horizontal = "─"; + }; + }; + }; + }; +} diff --git a/modules/home-manager/all-modules.nix b/modules/home-manager/all-modules.nix index 441e8e0e..b151e841 100644 --- a/modules/home-manager/all-modules.nix +++ b/modules/home-manager/all-modules.nix @@ -1,4 +1,5 @@ [ + ./aerc.nix ./alacritty.nix ./bat.nix ./bottom.nix diff --git a/tests/home.nix b/tests/home.nix index f13cba04..e2b86102 100644 --- a/tests/home.nix +++ b/tests/home.nix @@ -17,6 +17,7 @@ i18n.inputMethod.enabled = "fcitx5"; programs = { + aerc.enable = true; alacritty.enable = true; bat.enable = true; bottom.enable = true;