~aasg/nixexprs

50ca12cb9d230cdfbcf712a8839927674f08f09d — Aluísio Augusto Silva Gonçalves 6 months ago d91b29c
dma: Allow package to be configured

This is mostly so we can drop the import for a file that no longer
exists (pkgs/default.nix), but also for consistency with other NixOS
modules.
1 files changed, 9 insertions(+), 4 deletions(-)

M modules/programs/dma.nix
M modules/programs/dma.nix => modules/programs/dma.nix +9 -4
@@ 3,8 3,6 @@ with import ../../lib/extension.nix { inherit lib; };
let
  cfg = config.programs.dma;

  package = pkgs.dma or (import ../../pkgs { inherit pkgs; }).dma;

  relayConfig = relay: ''
    SMARTHOST ${relay.host}
    PORT ${toString relay.port}


@@ 51,6 49,13 @@ in
    programs.dma = {
      enable = mkEnableOption "DragonFly Mail Agent";

      package = mkOption {
        default = pkgs.dma;
        defaultText = "pkgs.dma";
        type = types.package;
        description = "dma package to use.";
      };

      user = mkOption {
        type = types.str;
        default = "dma";


@@ 151,10 156,10 @@ in
      groups.${cfg.group} = { };
    };

    environment.systemPackages = [ package ];
    environment.systemPackages = [ cfg.package ];
    services.mail.sendmailSetuidWrapper = mkIf cfg.setSendmail {
      program = "sendmail";
      source = "${package}/bin/dma";
      source = "${cfg.package}/bin/dma";
      owner = cfg.user;
      group = cfg.group;
      setuid = true;