summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2024-04-30 21:34:57 +0530
committersinanmohd <sinan@sinanmohd.com>2024-04-30 21:35:13 +0530
commitca4b64c69773fba244256efcfb9eda8764e93ca6 (patch)
tree2e88b49a861002db56c3e4b994589fdad5073059
parente7fd76000afa7b6bab6285a49adc6471c5d38bea (diff)
modules/stalwart-mail: avoid global `with lib`
-rw-r--r--nixos/common/modules/stalwart-mail.nix16
1 files changed, 6 insertions, 10 deletions
diff --git a/nixos/common/modules/stalwart-mail.nix b/nixos/common/modules/stalwart-mail.nix
index f784af5..68e8400 100644
--- a/nixos/common/modules/stalwart-mail.nix
+++ b/nixos/common/modules/stalwart-mail.nix
@@ -1,8 +1,4 @@
-{ config, lib, pkgs, ... }:
-
-with lib;
-
-let
+{ config, lib, pkgs, ... }: let
cfg = config.services.stalwart-mail;
configFormat = pkgs.formats.toml { };
configFile = configFormat.generate "stalwart-mail.toml" cfg.settings;
@@ -28,8 +24,8 @@ let
settingsDefault = recursiveUpdateList (map (path: readTOML path) cfgFiles);
in {
options.services.stalwart-mail = {
- enable = mkEnableOption "the Stalwart all-in-one email server";
- package = mkPackageOption pkgs "stalwart-mail" { };
+ enable = lib.mkEnableOption "the Stalwart all-in-one email server";
+ package = lib.mkPackageOption pkgs "stalwart-mail" { };
loadCredential = lib.mkOption {
type = lib.types.listOf lib.types.str;
@@ -42,7 +38,7 @@ in {
'';
};
- settings = mkOption {
+ settings = lib.mkOption {
inherit (configFormat) type;
default = { };
description = ''
@@ -54,7 +50,7 @@ in {
};
};
- config = mkIf cfg.enable {
+ config = lib.mkIf cfg.enable {
# set the default upstream settings
# assumptions
# 1. ./config.toml exists and only containts include.files and macros
@@ -162,6 +158,6 @@ in {
};
meta = {
- maintainers = with maintainers; [ happysalada pacien ];
+ maintainers = with lib.maintainers; [ happysalada pacien ];
};
}