Skip to content

Commit

Permalink
imapnotify: Use JSON type for extraConfig (#4238)
Browse files Browse the repository at this point in the history
Prior to this change, it was impossible to nest attrsets in
accounts.email.accounts.<name>.imapnotify.extraConfig. However,
goimapnotify's configuration is JSON-based, and the recommended
configuration has:
```
  "tlsOptions": {
    "rejectUnauthorized": true
  },
```

This change changes the type from an attrset of str/int/bool to the
JSON type provided by nixpkg's `pkgs.formats.json`.
  • Loading branch information
dryya authored Jul 15, 2023
1 parent 3460322 commit f5b03fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions modules/services/imapnotify-accounts.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, ... }:
{ pkgs, lib, ... }:

with lib;

Expand Down Expand Up @@ -31,7 +31,7 @@ with lib;
};

extraConfig = mkOption {
type = with types; attrsOf (oneOf [ bool int str ]);
type = let jsonFormat = pkgs.formats.json { }; in jsonFormat.type;
default = { };
example = { wait = 10; };
description = "Additional configuration to add for this account.";
Expand Down
4 changes: 3 additions & 1 deletion modules/services/imapnotify.nix
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ in {
};

accounts.email.accounts = mkOption {
type = with types; attrsOf (submodule (import ./imapnotify-accounts.nix));
type = with types;
attrsOf
(submodule (import ./imapnotify-accounts.nix { inherit pkgs lib; }));
};
};

Expand Down

0 comments on commit f5b03fe

Please sign in to comment.