Skip to content

Commit 46e424a

Browse files
authored
nixos/dokuwiki: Remove unused enable option (#391057)
2 parents df4d9b6 + 100559d commit 46e424a

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

nixos/modules/services/web-apps/dokuwiki.nix

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,29 @@ let
128128

129129
siteOpts = { options, config, lib, name, ... }:
130130
{
131+
# TODO: Remove in time for 25.11 and/or simplify once https://github.com/NixOS/nixpkgs/issues/96006 is fixed
132+
imports = [
133+
({config, options, ... }: let
134+
removalNote = "The option has had no effect for 3+ years. There is no replacement available.";
135+
optPath = lib.options.showOption [ "services" "dokuwiki" "sites" name "enable" ];
136+
in {
137+
options.enable = mkOption {
138+
visible = false;
139+
apply = x: throw "The option `${optPath}' can no longer be used since it's been removed. ${removalNote}";
140+
};
141+
config.assertions = [
142+
{
143+
assertion = !options.enable.isDefined;
144+
message = ''
145+
The option definition `${optPath}' in ${showFiles options.enable.files} no longer has any effect; please remove it.
146+
${removalNote}
147+
'';
148+
}
149+
];
150+
})
151+
];
131152

132153
options = {
133-
enable = mkEnableOption "DokuWiki web application";
134-
135154
package = mkPackageOption pkgs "dokuwiki" { };
136155

137156
stateDir = mkOption {
@@ -342,6 +361,13 @@ let
342361
'';
343362
};
344363

364+
# TODO: Remove when no submodule-level assertions are needed anymore
365+
assertions = mkOption {
366+
type = types.listOf types.unspecified;
367+
default = [ ];
368+
visible = false;
369+
internal = true;
370+
};
345371
};
346372
};
347373
in
@@ -374,6 +400,8 @@ in
374400

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

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

0 commit comments

Comments
 (0)