mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-29 21:51:01 +01:00
khard: add option to contact module for khard dir
Add an extra option,
accounts.contact.accounts.<name>.khard.defaultCollection
to hardcode a subdirectory for khard to function as intended. Khard
expects to be given a collection directory directly, from which there
can be multiple of in a vdir. This contrasts khal or vdirsyncer which
support recursive search.
Fixes #4531
This commit is contained in:
parent
90ae324e2c
commit
a38f88045e
4 changed files with 44 additions and 2 deletions
|
|
@ -68,6 +68,11 @@ in {
|
|||
type = with lib.types;
|
||||
attrsOf (submodule {
|
||||
options.khard.enable = lib.mkEnableOption "khard access";
|
||||
options.khard.defaultCollection = lib.mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
description = "VCARD collection to be searched by khard.";
|
||||
};
|
||||
});
|
||||
};
|
||||
};
|
||||
|
|
@ -75,11 +80,17 @@ in {
|
|||
config = lib.mkIf cfg.enable {
|
||||
home.packages = [ pkgs.khard ];
|
||||
|
||||
xdg.configFile."khard/khard.conf".text = ''
|
||||
xdg.configFile."khard/khard.conf".text = let
|
||||
makePath = anAccount:
|
||||
builtins.toString (/. + lib.concatStringsSep "/" [
|
||||
anAccount.local.path
|
||||
anAccount.khard.defaultCollection
|
||||
]);
|
||||
in ''
|
||||
[addressbooks]
|
||||
${lib.concatMapStringsSep "\n" (acc: ''
|
||||
[[${acc.name}]]
|
||||
path = ${acc.local.path}
|
||||
path = ${makePath acc}
|
||||
'') (lib.attrValues accounts)}
|
||||
|
||||
${renderSettings cfg.settings}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue