anchor.diff:        };
       };
   
  -    systemd.services.keepalived = {
  +    systemd.services.keepalived = let
  +      finalConfigFile = if cfg.secretFile == null then keepalivedConf else "/run/keepalived/keepalived.conf";
  +    in {
         description = "Keepalive Daemon (LVS and VRRP)";
         after = [ "network.target" "network-online.target" "syslog.target" ];
         wants = [ "network-online.target" ];
  
positive.code:         '';
        };
  
      };
    };
  
  
negative.code:         Type = "forking";
          PIDFile = pidFile;
          KillMode = "process";
          RuntimeDirectory = "keepalived";
          EnvironmentFile = lib.optional (cfg.secretFile != null) cfg.secretFile;
          ExecStartPre = lib.optional (cfg.secretFile != null)
          (pkgs.writeShellScript "keepalived-pre-start" ''
            umask 077
            ${pkgs.envsubst}/bin/envsubst -i "${keepalivedConf}" > ${finalConfigFile}
          '');
          ExecStart = "${pkgs.keepalived}/sbin/keepalived"
            + " -f ${finalConfigFile}"
            + " -p ${pidFile}"
            + optionalString cfg.snmp.enable " --snmp";
          ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
  