6afb255d97
these changes were generated with nixq 0.0.2, by running nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix two mentions of the mdDoc function remain in nixos/, both of which are inside of comments. Since lib.mdDoc is already defined as just id, this commit is a no-op as far as Nix (and the built manual) is concerned.
57 lines
1.1 KiB
Nix
57 lines
1.1 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.services.saslauthd;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
###### interface
|
|
|
|
options = {
|
|
|
|
services.saslauthd = {
|
|
|
|
enable = mkEnableOption "saslauthd, the Cyrus SASL authentication daemon";
|
|
|
|
package = mkPackageOption pkgs [ "cyrus_sasl" "bin" ] { };
|
|
|
|
mechanism = mkOption {
|
|
type = types.str;
|
|
default = "pam";
|
|
description = "Auth mechanism to use";
|
|
};
|
|
|
|
config = mkOption {
|
|
type = types.lines;
|
|
default = "";
|
|
description = "Configuration to use for Cyrus SASL authentication daemon.";
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
###### implementation
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
systemd.services.saslauthd = {
|
|
description = "Cyrus SASL authentication daemon";
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
serviceConfig = {
|
|
ExecStart = "@${cfg.package}/sbin/saslauthd saslauthd -a ${cfg.mechanism} -O ${pkgs.writeText "saslauthd.conf" cfg.config}";
|
|
Type = "forking";
|
|
PIDFile = "/run/saslauthd/saslauthd.pid";
|
|
Restart = "always";
|
|
};
|
|
};
|
|
};
|
|
}
|