nixos/go-autoconfig: init module

Changed files
+76
nixos
doc
manual
from_md
release-notes
release-notes
modules
services
networking
+7
nixos/doc/manual/from_md/release-notes/rl-2211.section.xml
···
</listitem>
<listitem>
<para>
<link xlink:href="https://www.grafana.com/oss/tempo/">Grafana
Tempo</link>, a distributed tracing store. Available as
<link linkend="opt-services.tempo.enable">services.tempo</link>.
···
</listitem>
<listitem>
<para>
+
<link xlink:href="https://github.com/L11R/go-autoconfig">go-autoconfig</link>,
+
IMAP/SMTP autodiscover server. Available as
+
<link linkend="opt-services.go-autoconfig.enable">services.go-autoconfig</link>.
+
</para>
+
</listitem>
+
<listitem>
+
<para>
<link xlink:href="https://www.grafana.com/oss/tempo/">Grafana
Tempo</link>, a distributed tracing store. Available as
<link linkend="opt-services.tempo.enable">services.tempo</link>.
+2
nixos/doc/manual/release-notes/rl-2211.section.md
···
- [expressvpn](https://www.expressvpn.com), the CLI client for ExpressVPN. Available as [services.expressvpn](#opt-services.expressvpn.enable).
- [Grafana Tempo](https://www.grafana.com/oss/tempo/), a distributed tracing store. Available as [services.tempo](#opt-services.tempo.enable).
- [AusweisApp2](https://www.ausweisapp.bund.de/), the authentication software for the German ID card. Available as [programs.ausweisapp](#opt-programs.ausweisapp.enable).
···
- [expressvpn](https://www.expressvpn.com), the CLI client for ExpressVPN. Available as [services.expressvpn](#opt-services.expressvpn.enable).
+
- [go-autoconfig](https://github.com/L11R/go-autoconfig), IMAP/SMTP autodiscover server. Available as [services.go-autoconfig](#opt-services.go-autoconfig.enable).
+
- [Grafana Tempo](https://www.grafana.com/oss/tempo/), a distributed tracing store. Available as [services.tempo](#opt-services.tempo.enable).
- [AusweisApp2](https://www.ausweisapp.bund.de/), the authentication software for the German ID card. Available as [programs.ausweisapp](#opt-programs.ausweisapp.enable).
+1
nixos/modules/module-list.nix
···
./services/networking/git-daemon.nix
./services/networking/globalprotect-vpn.nix
./services/networking/gnunet.nix
./services/networking/go-neb.nix
./services/networking/go-shadowsocks2.nix
./services/networking/gobgpd.nix
···
./services/networking/git-daemon.nix
./services/networking/globalprotect-vpn.nix
./services/networking/gnunet.nix
+
./services/networking/go-autoconfig.nix
./services/networking/go-neb.nix
./services/networking/go-shadowsocks2.nix
./services/networking/gobgpd.nix
+66
nixos/modules/services/networking/go-autoconfig.nix
···
···
+
{ config, lib, pkgs, ... }:
+
+
with lib;
+
+
let
+
+
cfg = config.services.go-autoconfig;
+
format = pkgs.formats.yaml { };
+
configFile = format.generate "config.yml" cfg.settings;
+
+
in {
+
options = {
+
services.go-autoconfig = {
+
+
enable = mkEnableOption (mdDoc "IMAP/SMTP autodiscover feature for mail clients");
+
+
settings = mkOption {
+
default = { };
+
description = mdDoc ''
+
Configuration for go-autoconfig. See
+
<https://github.com/L11R/go-autoconfig/blob/master/config.yml>
+
for more information.
+
'';
+
type = types.submodule {
+
freeformType = format.type;
+
};
+
example = literalExpression ''
+
{
+
service_addr = ":1323";
+
domain = "autoconfig.example.org";
+
imap = {
+
server = "example.org";
+
port = 993;
+
};
+
smtp = {
+
server = "example.org";
+
port = 465;
+
};
+
}
+
'';
+
};
+
+
};
+
};
+
+
config = mkIf cfg.enable {
+
+
systemd = {
+
services.go-autoconfig = {
+
wantedBy = [ "multi-user.target" ];
+
description = "IMAP/SMTP autodiscover server";
+
after = [ "network.target" ];
+
serviceConfig = {
+
ExecStart = "${pkgs.go-autoconfig}/bin/go-autoconfig -config ${configFile}";
+
Restart = "on-failure";
+
WorkingDirectory = ''${pkgs.go-autoconfig}/'';
+
DynamicUser = true;
+
};
+
};
+
};
+
+
};
+
+
meta.maintainers = with lib.maintainers; [ onny ];
+
+
}