Commit 38708759 authored by lschuetze's avatar lschuetze
Browse files

sabnzbd: do not render config by default at system state version < 26.05

parent 3b80034a
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -101,7 +101,8 @@ let
    else
      (configObjIni { }).generate "public-settings.ini" allSettings;

  sabnzbdIniPath = "/var/lib/${cfg.stateDir}/sabnzbd.ini";
  sabnzbdIniPath =
    if cfg.configFile != null then cfg.configFile else "/var/lib/${cfg.stateDir}/sabnzbd.ini";
in

{
@@ -113,8 +114,12 @@ in

      configFile = mkOption {
        type = types.nullOr types.path;
        default = null;
        description = "Path to config file (deprecated, use `settings` instead)";
        default =
          if lib.versionOlder config.system.stateVersion "26.05" then
            "/var/lib/sabnzbd/sabnzbd.ini"
          else
            null;
        description = "Path to config file (deprecated, use `settings` instead and set this value to null)";
      };

      stateDir = mkOption {
@@ -509,6 +514,9 @@ in
    systemd.services.sabnzbd =
      let
        files =
          if cfg.configFile != null then
            [ sabnzbdIniPath ]
          else
            (lib.optional cfg.allowConfigWrite sabnzbdIniPath) ++ [ publicSettingsIni ] ++ cfg.secretFiles;
        iniPathQuoted = lib.escapeShellArg sabnzbdIniPath;
      in