mirror of
https://gitlab.com/simple-nixos-mailserver/nixos-mailserver.git
synced 2024-12-28 03:50:34 +05:00
Merge pull request #128 from Infinisil/fix-enable-conditions
fix conditions for enabling services
This commit is contained in:
commit
f016b9689a
@ -56,7 +56,7 @@ let
|
||||
${cmdPostexec}
|
||||
'';
|
||||
in {
|
||||
config = lib.mkIf config.mailserver.borgbackup.enable {
|
||||
config = lib.mkIf (config.mailserver.enable && cfg.enable) {
|
||||
environment.systemPackages = with pkgs; [
|
||||
borgbackup
|
||||
];
|
||||
|
@ -20,7 +20,7 @@ let
|
||||
cfg = config.mailserver;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf cfg.virusScanning {
|
||||
config = lib.mkIf (cfg.enable && cfg.virusScanning) {
|
||||
services.clamav.daemon.enable = true;
|
||||
services.clamav.updater.enable = true;
|
||||
|
||||
|
@ -20,7 +20,7 @@ let
|
||||
cfg = config.mailserver;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf cfg.localDnsResolver {
|
||||
config = lib.mkIf (cfg.enable && cfg.localDnsResolver) {
|
||||
services.kresd.enable = true;
|
||||
networking.nameservers = [ "127.0.0.1" ];
|
||||
};
|
||||
|
@ -20,7 +20,7 @@ let
|
||||
cfg = config.mailserver;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf cfg.monitoring.enable {
|
||||
config = lib.mkIf (cfg.enable && cfg.monitoring.enable) {
|
||||
services.monit = {
|
||||
enable = true;
|
||||
config = ''
|
||||
|
@ -24,7 +24,7 @@ let
|
||||
acmeRoot = "/var/lib/acme/acme-challenge";
|
||||
in
|
||||
{
|
||||
config = lib.mkIf (cfg.certificateScheme == 3) {
|
||||
config = lib.mkIf (cfg.enable && cfg.certificateScheme == 3) {
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
virtualHosts."${cfg.fqdn}" = {
|
||||
|
@ -22,7 +22,7 @@ let
|
||||
cfg = config.mailserver;
|
||||
in
|
||||
{
|
||||
config = mkIf cfg.rebootAfterKernelUpgrade.enable {
|
||||
config = mkIf (cfg.enable && cfg.rebootAfterKernelUpgrade.enable) {
|
||||
systemd.services.nixos-upgrade.serviceConfig.ExecStartPost = pkgs.writeScript "post-upgrade-check" ''
|
||||
#!${pkgs.stdenv.shell}
|
||||
|
||||
|
@ -39,7 +39,7 @@ let
|
||||
'';
|
||||
postexecString = optionalString postexecDefined "cmd_postexec ${postexecWrapped}";
|
||||
in {
|
||||
config = mkIf cfg.backup.enable {
|
||||
config = mkIf (cfg.enable && cfg.backup.enable) {
|
||||
services.rsnapshot = {
|
||||
enable = true;
|
||||
cronIntervals = cfg.backup.cronIntervals;
|
||||
|
Loading…
Reference in New Issue
Block a user