Commit 1f4329cd authored by Jonas Heinrich's avatar Jonas Heinrich
Browse files

nixos/stalwart-mail: pin module to package version 0.6

parent c5cfeb11
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -591,6 +591,8 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m
- `buildDubPackage` can now be used to build Programs written in [D](https://dlang.org/) using the `dub` build system and package manager.
  See the [D section](https://nixos.org/manual/nixpkgs/unstable#dlang) in the manual for more information.

- `stalwart-mail` service uses the legacy version 0.6.X as default because newer `stalwart-mail` versions require a [manual upgrade process](https://github.com/stalwartlabs/mail-server/blob/main/UPGRADING.md). Change [`services.stalwart-mail.package`](#opt-services.stalwart-mail.package) to `pkgs.stalwart-mail` if you wish to switch to the new version.

- [`portunus`](https://github.com/majewsky/portunus) has been updated to major version 2.
  This version of Portunus supports strong password hashes, but the legacy hash SHA-256 is also still supported to ensure a smooth migration of existing user accounts.
  After upgrading, follow the instructions on the [upstream release notes](https://github.com/majewsky/portunus/releases/tag/v2.0.0) to upgrade all user accounts to strong password hashes.
+30 −1
Original line number Diff line number Diff line
@@ -7,11 +7,28 @@ let
  configFormat = pkgs.formats.toml { };
  configFile = configFormat.generate "stalwart-mail.toml" cfg.settings;
  dataDir = "/var/lib/stalwart-mail";
  stalwartAtLeast = versionAtLeast cfg.package.version;

in {
  options.services.stalwart-mail = {
    enable = mkEnableOption "the Stalwart all-in-one email server";
    package = mkPackageOption pkgs "stalwart-mail" { };

    package = mkOption {
      type = types.package;
      description = ''
        Which package to use for the Stalwart mail server.

        ::: {.note}
        Upgrading from version 0.6.0 to version 0.7.0 or higher requires manual
        intervention. See <https://github.com/stalwartlabs/mail-server/blob/main/UPGRADING.md>
        for upgrade instructions.
        :::
      '';
      default = pkgs.stalwart-mail_0_6;
      defaultText = lib.literalExpression "pkgs.stalwart-mail_0_6";
      example = lib.literalExpression "pkgs.stalwart-mail";
      relatedPackages = [ "stalwart-mail_0_6" "stalwart-mail" ];
    };

    settings = mkOption {
      inherit (configFormat) type;
@@ -26,6 +43,18 @@ in {
  };

  config = mkIf cfg.enable {

    warnings = lib.optionals (!stalwartAtLeast "0.7.0") [
      ''
        Versions of stalwart-mail < 0.7.0 will get deprecated in NixOS 24.11.
        Please set services.stalwart-mail.package to pkgs.stalwart-mail to
        upgrade to the latest version.
        Please note that upgrading to version >= 0.7 requires manual
        intervention, see <https://github.com/stalwartlabs/mail-server/blob/main/UPGRADING.md>
        for upgrade instructions.
      ''
    ];

    # Default config: all local
    services.stalwart-mail.settings = {
      global.tracing.method = mkDefault "stdout";