sourcehut: drop obsolete `services` array in favor of indivdual `enable` flags

Signed-off-by: Christoph Heiss <christoph@c8h4.io>

Changed files
+5 -18
nixos
modules
services
misc
tests
+5 -10
nixos/modules/services/misc/sourcehut/default.nix
···
|| head srvMatch == srv # Include sections for the service being configured
then v
# Enable Web links and integrations between services.
-
else if tail srvMatch == [ null ] && elem (head srvMatch) cfg.services
+
else if tail srvMatch == [ null ] && cfg.${head srvMatch}.enable
then {
inherit (v) origin;
# mansrht crashes without it
···
sourcehut - git hosting, continuous integration, mailing list, ticket tracking, wiki
and account management services
'');
-
-
services = mkOption {
-
type = with types; listOf (enum
-
[ "builds" "git" "hg" "hub" "lists" "man" "meta" "pages" "paste" "todo" ]);
-
defaultText = "locally enabled services";
-
description = lib.mdDoc ''
-
Services that may be displayed as links in the title bar of the Web interface.
-
'';
-
};
listenAddress = mkOption {
type = types.str;
···
(mkRemovedOptionModule [ "services" "sourcehut" "dispatch" ] ''
dispatch is deprecated. See https://sourcehut.org/blog/2022-08-01-dispatch-deprecation-plans/
for more information.
+
'')
+
+
(mkRemovedOptionModule [ "services" "sourcehut" "services"] ''
+
This option was removed in favor of individual <service>.enable flags.
'')
];
-3
nixos/modules/services/misc/sourcehut/service.nix
···
}) [srvCfg.user];
};
-
services.sourcehut.services = mkDefault (filter (s: cfg.${s}.enable)
-
[ "builds" "dispatch" "git" "hg" "hub" "lists" "man" "meta" "pages" "paste" "todo" ]);
-
services.sourcehut.settings = mkMerge [
{
"${srv}.sr.ht".origin = mkDefault "https://${srv}.${cfg.settings."sr.ht".global-domain}";
-5
nixos/tests/sourcehut.nix
···
services.sourcehut = {
enable = true;
-
services = [
-
"builds"
-
"git"
-
"meta"
-
];
nginx.enable = true;
nginx.virtualHost = {
forceSSL = true;