From 100559d83c9468a70bb5c711d48af7e9cacef0e3 Mon Sep 17 00:00:00 2001 From: e1mo Date: Tue, 18 Mar 2025 20:25:16 +0100 Subject: [PATCH] nixos/dokuwiki: Remove unused enable option The option has been added in 50029ed89ce5e38f0b893689762c7ead26c2f678 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. --- nixos/modules/services/web-apps/dokuwiki.nix | 32 ++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/web-apps/dokuwiki.nix b/nixos/modules/services/web-apps/dokuwiki.nix index c5ea809c8d59..ceb974570385 100644 --- a/nixos/modules/services/web-apps/dokuwiki.nix +++ b/nixos/modules/services/web-apps/dokuwiki.nix @@ -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}" {