summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristoph Heiss <christoph@c8h4.io>2023-08-07 21:15:35 +0200
committerChristoph Heiss <christoph@c8h4.io>2023-11-11 13:01:47 +0100
commit78cc2783c8e8322e80cd0ee68409cd537e7202a6 (patch)
tree9afc96e8d6efbcd50d7dc3c8f96be1c496bfdfcf
parent6b25e09d2dfe8b92db9ae148989d6d7aaad2dd7f (diff)
downloadnixpkgs-78cc2783c8e8322e80cd0ee68409cd537e7202a6.tar
nixpkgs-78cc2783c8e8322e80cd0ee68409cd537e7202a6.tar.gz
nixpkgs-78cc2783c8e8322e80cd0ee68409cd537e7202a6.tar.bz2
nixpkgs-78cc2783c8e8322e80cd0ee68409cd537e7202a6.tar.lz
nixpkgs-78cc2783c8e8322e80cd0ee68409cd537e7202a6.tar.xz
nixpkgs-78cc2783c8e8322e80cd0ee68409cd537e7202a6.tar.zst
nixpkgs-78cc2783c8e8322e80cd0ee68409cd537e7202a6.zip
sourcehut: drop obsolete `services` array in favor of indivdual `enable` flags
Signed-off-by: Christoph Heiss <christoph@c8h4.io>
-rw-r--r--nixos/modules/services/misc/sourcehut/default.nix15
-rw-r--r--nixos/modules/services/misc/sourcehut/service.nix3
-rw-r--r--nixos/tests/sourcehut.nix5
3 files changed, 5 insertions, 18 deletions
diff --git a/nixos/modules/services/misc/sourcehut/default.nix b/nixos/modules/services/misc/sourcehut/default.nix
index abe2370483c..293ab4ada84 100644
--- a/nixos/modules/services/misc/sourcehut/default.nix
+++ b/nixos/modules/services/misc/sourcehut/default.nix
@@ -25,7 +25,7 @@ let
       || 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
@@ -120,15 +120,6 @@ in
       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;
       default = "localhost";
@@ -1371,6 +1362,10 @@ in
         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.
+    '')
   ];
 
   meta.doc = ./default.md;
diff --git a/nixos/modules/services/misc/sourcehut/service.nix b/nixos/modules/services/misc/sourcehut/service.nix
index 26fbb3a1136..dcd76f898f9 100644
--- a/nixos/modules/services/misc/sourcehut/service.nix
+++ b/nixos/modules/services/misc/sourcehut/service.nix
@@ -255,9 +255,6 @@ in
         }) [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}";
diff --git a/nixos/tests/sourcehut.nix b/nixos/tests/sourcehut.nix
index 87e6d82bdd8..0529abd73a8 100644
--- a/nixos/tests/sourcehut.nix
+++ b/nixos/tests/sourcehut.nix
@@ -134,11 +134,6 @@ in
 
     services.sourcehut = {
       enable = true;
-      services = [
-        "builds"
-        "git"
-        "meta"
-      ];
       nginx.enable = true;
       nginx.virtualHost = {
         forceSSL = true;