From befdb97b1959ecd2c5a765bd1fc91e5834818c5e Mon Sep 17 00:00:00 2001 From: Pancake Appletree <189892522+appleptree@users.noreply.github.com> Date: Sat, 2 May 2026 22:30:15 +0200 Subject: [PATCH 1/3] feat(wrapperModules.aerc): init --- wrapperModules/a/aerc/module.nix | 95 ++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 wrapperModules/a/aerc/module.nix diff --git a/wrapperModules/a/aerc/module.nix b/wrapperModules/a/aerc/module.nix new file mode 100644 index 00000000..518d73f8 --- /dev/null +++ b/wrapperModules/a/aerc/module.nix @@ -0,0 +1,95 @@ +{ + config, + lib, + wlib, + pkgs, + ... +}: +let + iniFmt = pkgs.formats.ini { }; + iniWithGlobalFmt = pkgs.formats.iniWithGlobalSection { }; +in +{ + imports = [ wlib.modules.default ]; + options = { + settings = lib.mkOption { + type = iniFmt.type; + default = { }; + description = '' + Aerc main configuration file. + See {manpage}`aerc-config(5)` + ''; + }; + keybinds = lib.mkOption { + type = iniWithGlobalFmt.type; + default = { }; + description = '' + Aerc keybinds configuration file. + See {manpage}`aerc-config(5)` + ''; + }; + accounts = lib.mkOption { + type = iniFmt.type; + default = { }; + description = '' + Aerc accounts configuration file. + Should not contain any plaintext secrets, as it's copied to nix store. + Use `outgoing-cred-cmd` and `source-cred-cmd` instead. + See {manpage}`aerc-config(5)` + ''; + }; + stylesets = lib.mkOption { + type = lib.types.attrsOf iniWithGlobalFmt.type; + default = { }; + description = '' + Stylesets (themes) for aerc. + See {manpage}`aerc-stylesets(5)` + ''; + }; + }; + config = + let + stylesets-content = lib.mapAttrs ( + name: value: lib.generators.toINIWithGlobalSection { } value + ) config.stylesets; + stylesets-constructFiles = lib.concatMapAttrs (name: value: { + "stylesets-${name}" = { + content = value; + relPath = "stylesets/${name}"; + }; + }) stylesets-content; + stylesets-dir = "${placeholder "out"}/stylesets"; + aerc-config = + if config.settings ? ui && config.settings.ui ? stylesets-dirs then + lib.recursiveUpdate config.settings { + ui.stylesets-dirs = "${config.settings.ui.stylesets-dirs},${stylesets-dir}"; + } + else + lib.recursiveUpdate config.settings { + ui.stylesets-dirs = stylesets-dir; + }; + in + { + constructFiles = { + aercConfig = { + content = lib.generators.toINI { } aerc-config; + relPath = "${config.binName}.conf"; + }; + keybindsConfig = { + content = lib.generators.toINIWithGlobalSection { } config.keybinds; + relPath = "${config.binName}-keybinds.conf"; + }; + accountsConfig = { + content = lib.generators.toINI { } config.accounts; + relPath = "${config.binName}-accounts.conf"; + }; + } + // stylesets-constructFiles; + flags = { + "--aerc-conf" = config.constructFiles.aercConfig.path; + "--binds-conf" = config.constructFiles.keybindsConfig.path; + "--accounts-conf" = config.constructFiles.accountsConfig.path; + }; + package = lib.mkDefault pkgs.aerc; + }; +} From 2b313f2e1f5782927bf4f847eb05eda8697b1545 Mon Sep 17 00:00:00 2001 From: Pancake Appletree <189892522+appleptree@users.noreply.github.com> Date: Sat, 2 May 2026 23:16:57 +0200 Subject: [PATCH 2/3] docs(wrapperModules.aerc): Reference the correct man pages --- wrapperModules/a/aerc/module.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wrapperModules/a/aerc/module.nix b/wrapperModules/a/aerc/module.nix index 518d73f8..57f00a89 100644 --- a/wrapperModules/a/aerc/module.nix +++ b/wrapperModules/a/aerc/module.nix @@ -25,7 +25,7 @@ in default = { }; description = '' Aerc keybinds configuration file. - See {manpage}`aerc-config(5)` + See {manpage}`aerc-binds(5)` ''; }; accounts = lib.mkOption { @@ -35,7 +35,7 @@ in Aerc accounts configuration file. Should not contain any plaintext secrets, as it's copied to nix store. Use `outgoing-cred-cmd` and `source-cred-cmd` instead. - See {manpage}`aerc-config(5)` + See {manpage}`aerc-accounts(5)` ''; }; stylesets = lib.mkOption { From 728d332d753216040c47818d476387ee28496e22 Mon Sep 17 00:00:00 2001 From: Pancake Appletree <189892522+appleptree@users.noreply.github.com> Date: Sat, 2 May 2026 23:25:36 +0200 Subject: [PATCH 3/3] fix(wrapperModules.aerc): Set myself as maintainer --- wrapperModules/a/aerc/module.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/wrapperModules/a/aerc/module.nix b/wrapperModules/a/aerc/module.nix index 57f00a89..cbb66968 100644 --- a/wrapperModules/a/aerc/module.nix +++ b/wrapperModules/a/aerc/module.nix @@ -91,5 +91,6 @@ in "--accounts-conf" = config.constructFiles.accountsConfig.path; }; package = lib.mkDefault pkgs.aerc; + meta.maintainers = [ wlib.maintainers.appleptree ]; }; }