aboutsummaryrefslogtreecommitdiff
path: root/modules/accounts
diff options
context:
space:
mode:
authorRobert Helgesson <robert@rycee.net>2020-04-06 12:51:11 +0200
committerRobert Helgesson <robert@rycee.net>2020-04-06 12:51:11 +0200
commita128e359272c52a963dcfe79962524f3bb3c0c2c (patch)
tree6c7cdc4ba13bc17e428b73c0f60465c36323dcc1 /modules/accounts
parentdd93c300bbd951776e546fdc251274cc8a184844 (diff)
Update nixfmt and apply to a few more files
Diffstat (limited to 'modules/accounts')
-rw-r--r--modules/accounts/email.nix64
1 files changed, 23 insertions, 41 deletions
diff --git a/modules/accounts/email.nix b/modules/accounts/email.nix
index b347e5bb1a2..a1970667b47 100644
--- a/modules/accounts/email.nix
+++ b/modules/accounts/email.nix
@@ -106,7 +106,7 @@ let
tls = mkOption {
type = tlsModule;
- default = {};
+ default = { };
description = ''
Configuration for secure connections.
'';
@@ -136,7 +136,7 @@ let
tls = mkOption {
type = tlsModule;
- default = {};
+ default = { };
description = ''
Configuration for secure connections.
'';
@@ -209,7 +209,7 @@ let
aliases = mkOption {
type = types.listOf (types.strMatching ".*@.*");
- default = [];
+ default = [ ];
example = [ "webmaster@example.org" "admin@example.org" ];
description = "Alternative email addresses of this account.";
};
@@ -276,7 +276,7 @@ let
};
};
};
- default = {};
+ default = { };
description = ''
Standard email folders.
'';
@@ -292,7 +292,7 @@ let
signature = mkOption {
type = signatureModule;
- default = {};
+ default = { };
description = ''
Signature configuration.
'';
@@ -332,9 +332,7 @@ let
(mkIf (config.flavor == "gmail.com") {
userName = mkDefault config.address;
- imap = {
- host = "imap.gmail.com";
- };
+ imap = { host = "imap.gmail.com"; };
smtp = {
host = "smtp.gmail.com";
@@ -343,20 +341,14 @@ let
})
(mkIf (config.flavor == "runbox.com") {
- imap = {
- host = "mail.runbox.com";
- };
+ imap = { host = "mail.runbox.com"; };
- smtp = {
- host = "mail.runbox.com";
- };
+ smtp = { host = "mail.runbox.com"; };
})
];
};
-in
-
-{
+in {
options.accounts.email = {
certificatesFile = mkOption {
type = types.path;
@@ -373,9 +365,7 @@ in
default = "${config.home.homeDirectory}/Maildir";
defaultText = "$HOME/Maildir";
apply = p:
- if hasPrefix "/" p
- then p
- else "${config.home.homeDirectory}/${p}";
+ if hasPrefix "/" p then p else "${config.home.homeDirectory}/${p}";
description = ''
The base directory for account maildir directories. May be a
relative path, in which case it is relative the home
@@ -395,32 +385,24 @@ in
(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 = {};
+ ] ++ optionals pkgs.stdenv.hostPlatform.isLinux
+ [ (import ../services/lieer-accounts.nix) ]));
+ default = { };
description = "List of email accounts.";
};
};
- config = mkIf (cfg.accounts != {}) {
+ config = mkIf (cfg.accounts != { }) {
assertions = [
- (
- let
- primaries =
- catAttrs "name"
- (filter (a: a.primary)
- (attrValues cfg.accounts));
- in
- {
- assertion = length primaries == 1;
- message =
- "Must have exactly one primary mail account but found "
- + toString (length primaries)
- + optionalString (length primaries > 1)
- (", namely " + concatStringsSep ", " primaries);
- }
- )
+ (let
+ primaries =
+ catAttrs "name" (filter (a: a.primary) (attrValues cfg.accounts));
+ in {
+ assertion = length primaries == 1;
+ message = "Must have exactly one primary mail account but found "
+ + toString (length primaries) + optionalString (length primaries > 1)
+ (", namely " + concatStringsSep ", " primaries);
+ })
];
};
}