mirror of
https://github.com/nix-community/home-manager
synced 2024-12-02 07:59:46 +01:00
Move email account options to their owning modules
This removes the long list of submodules from modules/accounts/email.nix and instead move each entry to its owning module.
This commit is contained in:
parent
ad4f33cfc4
commit
bf7297d55c
11 changed files with 131 additions and 98 deletions
|
@ -374,19 +374,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
accounts = mkOption {
|
accounts = mkOption {
|
||||||
type = types.attrsOf (types.submodule ([
|
type = types.attrsOf (types.submodule mailAccountOpts);
|
||||||
mailAccountOpts
|
|
||||||
(import ../programs/alot-accounts.nix pkgs)
|
|
||||||
(import ../programs/astroid-accounts.nix)
|
|
||||||
(import ../programs/getmail-accounts.nix)
|
|
||||||
(import ../programs/lieer-accounts.nix)
|
|
||||||
(import ../programs/mbsync-accounts.nix)
|
|
||||||
(import ../programs/msmtp-accounts.nix)
|
|
||||||
(import ../programs/neomutt-accounts.nix)
|
|
||||||
(import ../programs/notmuch-accounts.nix)
|
|
||||||
(import ../programs/offlineimap-accounts.nix)
|
|
||||||
] ++ optionals pkgs.stdenv.hostPlatform.isLinux
|
|
||||||
[ (import ../services/lieer-accounts.nix) ]));
|
|
||||||
default = { };
|
default = { };
|
||||||
description = "List of email accounts.";
|
description = "List of email accounts.";
|
||||||
};
|
};
|
||||||
|
|
|
@ -114,7 +114,8 @@ let
|
||||||
'';
|
'';
|
||||||
|
|
||||||
in {
|
in {
|
||||||
options.programs.alot = {
|
options = {
|
||||||
|
programs.alot = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
|
@ -217,6 +218,11 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
accounts.email.accounts = mkOption {
|
||||||
|
type = with types; attrsOf (submodule (import ./alot-accounts.nix pkgs));
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = [ pkgs.alot ];
|
home.packages = [ pkgs.alot ];
|
||||||
|
|
||||||
|
|
|
@ -98,6 +98,10 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
accounts.email.accounts = mkOption {
|
||||||
|
type = with types; attrsOf (submodule (import ./astroid-accounts.nix));
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
|
@ -49,6 +49,12 @@ let
|
||||||
".getmail/getmail${if a.primary then "rc" else a.name}";
|
".getmail/getmail${if a.primary then "rc" else a.name}";
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
options = {
|
||||||
|
accounts.email.accounts = mkOption {
|
||||||
|
type = with types; attrsOf (submodule (import ./getmail-accounts.nix));
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
config = mkIf getmailEnabled {
|
config = mkIf getmailEnabled {
|
||||||
home.file = foldl' (a: b: a // b) { }
|
home.file = foldl' (a: b: a // b) { }
|
||||||
(map (a: { "${renderConfigFilepath a}".text = renderAccountConfig a; })
|
(map (a: { "${renderConfigFilepath a}".text = renderAccountConfig a; })
|
||||||
|
|
|
@ -43,6 +43,10 @@ in {
|
||||||
options = {
|
options = {
|
||||||
programs.lieer.enable =
|
programs.lieer.enable =
|
||||||
mkEnableOption "lieer Gmail synchronization for notmuch";
|
mkEnableOption "lieer Gmail synchronization for notmuch";
|
||||||
|
|
||||||
|
accounts.email.accounts = mkOption {
|
||||||
|
type = with types; attrsOf (submodule (import ./lieer-accounts.nix));
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
|
|
@ -122,6 +122,10 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
accounts.email.accounts = mkOption {
|
||||||
|
type = with types; attrsOf (submodule (import ./mbsync-accounts.nix));
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
|
@ -56,6 +56,10 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
accounts.email.accounts = mkOption {
|
||||||
|
type = with types; attrsOf (submodule (import ./msmtp-accounts.nix));
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
|
@ -262,6 +262,10 @@ in {
|
||||||
description = "Extra configuration appended to the end.";
|
description = "Extra configuration appended to the end.";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
accounts.email.accounts = mkOption {
|
||||||
|
type = with types; attrsOf (submodule (import ./neomutt-accounts.nix));
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
|
@ -143,6 +143,10 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
accounts.email.accounts = mkOption {
|
||||||
|
type = with types; attrsOf (submodule (import ./notmuch-accounts.nix));
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
|
@ -147,6 +147,11 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
accounts.email.accounts = mkOption {
|
||||||
|
type = with types;
|
||||||
|
attrsOf (submodule (import ./offlineimap-accounts.nix));
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
|
@ -52,6 +52,10 @@ in {
|
||||||
options = {
|
options = {
|
||||||
services.lieer.enable =
|
services.lieer.enable =
|
||||||
mkEnableOption "lieer Gmail synchronization service";
|
mkEnableOption "lieer Gmail synchronization service";
|
||||||
|
|
||||||
|
accounts.email.accounts = mkOption {
|
||||||
|
type = with types; attrsOf (submodule (import ./lieer-accounts.nix));
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
Loading…
Reference in a new issue