treewide: implement auto importing for modules

Reduce maintenance burden and increase efficiency by automatically
importing modules following a specific convention.

Co-authored-by: awwpotato <awwpotato@voidq.com>
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
Austin Horstman 2025-06-20 14:39:55 -05:00
parent fefeb0e928
commit 4fca600cb1
461 changed files with 72 additions and 474 deletions

View file

@ -0,0 +1,44 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.abook;
in
{
options.programs.abook = {
enable = lib.mkEnableOption "Abook";
package = lib.mkPackageOption pkgs "abook" { nullable = true; };
extraConfig = lib.mkOption {
type = lib.types.lines;
default = "";
example = ''
field pager = Pager
view CONTACT = name, email
set autosave=true
'';
description = ''
Extra lines added to {file}`$HOME/.config/abook/abookrc`.
Available configuration options are described in the abook repository:
<https://sourceforge.net/p/abook/git/ci/master/tree/sample.abookrc>.
'';
};
};
config = lib.mkIf cfg.enable {
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
xdg.configFile."abook/abookrc" = lib.mkIf (cfg.extraConfig != "") {
text = ''
# Generated by Home Manager.
# See http://abook.sourceforge.net/
${cfg.extraConfig}
'';
};
};
}