Unverified Commit 100559d8 authored by e1mo's avatar e1mo
Browse files

nixos/dokuwiki: Remove unused enable option

The option has been added in 50029ed8
but never had any effect. As far as I could tell, it was only added for
backward compatibility. I think it's safe to remove this after 3+ years.

I opted for removal instead of implementing it since the module will
just do nothing if no site is configure, thus no enable / disable switch
is needed. Especially on a per-site level.
parent c46d43c6
Loading
Loading
Loading
Loading
+30 −2
Original line number Diff line number Diff line
@@ -124,10 +124,29 @@ let

  siteOpts = { options, config, lib, name, ... }:
    {
      # TODO: Remove in time for 25.11 and/or simplify once https://github.com/NixOS/nixpkgs/issues/96006 is fixed
      imports = [
        ({config, options, ... }: let
          removalNote = "The option has had no effect for 3+ years. There is no replacement available.";
          optPath = lib.options.showOption [ "services" "dokuwiki" "sites" name "enable" ];
        in {
          options.enable = mkOption {
            visible = false;
            apply = x: throw "The option `${optPath}' can no longer be used since it's been removed. ${removalNote}";
          };
          config.assertions = [
            {
              assertion = !options.enable.isDefined;
              message = ''
                The option definition `${optPath}' in ${showFiles options.enable.files} no longer has any effect; please remove it.
              ${removalNote}
              '';
            }
          ];
        })
      ];

      options = {
        enable = mkEnableOption "DokuWiki web application";

        package = mkPackageOption pkgs "dokuwiki" { };

        stateDir = mkOption {
@@ -338,6 +357,13 @@ let
          '';
        };

        # TODO: Remove when no submodule-level assertions are needed anymore
        assertions = mkOption {
          type = types.listOf types.unspecified;
          default = [ ];
          visible = false;
          internal = true;
        };
    };
  };
in
@@ -370,6 +396,8 @@ in

  # implementation
  config = mkIf (eachSite != {}) (mkMerge [{
    # TODO: Remove when no submodule-level assertions are needed anymore
    assertions = flatten (mapAttrsToList (_: cfg: cfg.assertions) eachSite);

    services.phpfpm.pools = mapAttrs' (hostName: cfg: (
      nameValuePair "dokuwiki-${hostName}" {