about summary refs log tree commit diff
path: root/nixpkgs/nixos/modules/services/web-apps
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-03-30 13:30:47 +0000
committerAlyssa Ross <hi@alyssa.is>2022-03-31 10:13:20 +0000
commitf2e61678de300336b3666afd19af7565efb0c4cf (patch)
tree49f6906c9d557f7fdd58257ff85ec17fc4495f31 /nixpkgs/nixos/modules/services/web-apps
parentf920d5e07c29a9aa1b77d9b88bd604cf1a1f3664 (diff)
parent00e27c78d3d2de6964096ceee8d70e5b487365e3 (diff)
downloadnixlib-f2e61678de300336b3666afd19af7565efb0c4cf.tar
nixlib-f2e61678de300336b3666afd19af7565efb0c4cf.tar.gz
nixlib-f2e61678de300336b3666afd19af7565efb0c4cf.tar.bz2
nixlib-f2e61678de300336b3666afd19af7565efb0c4cf.tar.lz
nixlib-f2e61678de300336b3666afd19af7565efb0c4cf.tar.xz
nixlib-f2e61678de300336b3666afd19af7565efb0c4cf.tar.zst
nixlib-f2e61678de300336b3666afd19af7565efb0c4cf.zip
Merge commit '00e27c78d3d2de6964096ceee8d70e5b487365e3'
Conflicts:
	nixpkgs/nixos/modules/system/boot/systemd.nix
	nixpkgs/pkgs/applications/networking/browsers/firefox/common.nix
	nixpkgs/pkgs/applications/version-management/git-and-tools/cgit/common.nix
	nixpkgs/pkgs/applications/version-management/git-and-tools/cgit/default.nix
	nixpkgs/pkgs/applications/version-management/git-and-tools/cgit/pink.nix
	nixpkgs/pkgs/top-level/all-packages.nix
Diffstat (limited to 'nixpkgs/nixos/modules/services/web-apps')
-rw-r--r--nixpkgs/nixos/modules/services/web-apps/keycloak.nix20
-rw-r--r--nixpkgs/nixos/modules/services/web-apps/nextcloud.nix11
2 files changed, 20 insertions, 11 deletions
diff --git a/nixpkgs/nixos/modules/services/web-apps/keycloak.nix b/nixpkgs/nixos/modules/services/web-apps/keycloak.nix
index 22c16be76139..c4a2127663a9 100644
--- a/nixpkgs/nixos/modules/services/web-apps/keycloak.nix
+++ b/nixpkgs/nixos/modules/services/web-apps/keycloak.nix
@@ -129,6 +129,14 @@ in
         '';
       };
 
+      plugins = lib.mkOption {
+        type = lib.types.listOf lib.types.path;
+        default = [];
+        description = ''
+          Keycloak plugin jar, ear files or derivations with them
+        '';
+      };
+
       database = {
         type = mkOption {
           type = enum [ "mysql" "postgresql" ];
@@ -787,6 +795,14 @@ in
 
               umask u=rwx,g=,o=
 
+              install_plugin() {
+                if [ -d "$1" ]; then
+                  find "$1" -type f \( -iname \*.ear -o -iname \*.jar \) -exec install -m 0500 -o keycloak -g keycloak "{}" "/run/keycloak/deployments/" \;
+                else
+                  install -m 0500 -o keycloak -g keycloak "$1" "/run/keycloak/deployments/"
+                fi
+              }
+
               install -m 0600 ${cfg.package}/standalone/configuration/*.properties /run/keycloak/configuration
               install -T -m 0600 ${keycloakConfig} /run/keycloak/configuration/standalone.xml
 
@@ -794,7 +810,9 @@ in
 
               export JAVA_OPTS=-Djboss.server.config.user.dir=/run/keycloak/configuration
               add-user-keycloak.sh -u admin -p '${cfg.initialAdminPassword}'
-            '' + optionalString (cfg.sslCertificate != null && cfg.sslCertificateKey != null) ''
+            ''
+            + lib.optionalString (cfg.plugins != []) (lib.concatStringsSep "\n" (map (pl: "install_plugin ${lib.escapeShellArg pl}") cfg.plugins)) + "\n"
+            + optionalString (cfg.sslCertificate != null && cfg.sslCertificateKey != null) ''
               pushd /run/keycloak/ssl/
               cat "$CREDENTIALS_DIRECTORY/ssl_cert" <(echo) \
                   "$CREDENTIALS_DIRECTORY/ssl_key" <(echo) \
diff --git a/nixpkgs/nixos/modules/services/web-apps/nextcloud.nix b/nixpkgs/nixos/modules/services/web-apps/nextcloud.nix
index 141ab98e29bf..b32220a5e579 100644
--- a/nixpkgs/nixos/modules/services/web-apps/nextcloud.nix
+++ b/nixpkgs/nixos/modules/services/web-apps/nextcloud.nix
@@ -153,7 +153,7 @@ in {
     package = mkOption {
       type = types.package;
       description = "Which package to use for the Nextcloud instance.";
-      relatedPackages = [ "nextcloud21" "nextcloud22" "nextcloud23" ];
+      relatedPackages = [ "nextcloud22" "nextcloud23" ];
     };
     phpPackage = mkOption {
       type = types.package;
@@ -571,15 +571,6 @@ in {
               nextcloud defined in an overlay, please set `services.nextcloud.package` to
               `pkgs.nextcloud`.
             ''
-          # 21.03 will not be an official release - it was instead 21.05.
-          # This versionOlder statement remains set to 21.03 for backwards compatibility.
-          # See https://github.com/NixOS/nixpkgs/pull/108899 and
-          # https://github.com/NixOS/rfcs/blob/master/rfcs/0080-nixos-release-schedule.md.
-          # FIXME(@Ma27) remove this else-if as soon as 21.05 is EOL! This is only here
-          # to ensure that users who are on Nextcloud 19 with a stateVersion <21.05 with
-          # no explicit services.nextcloud.package don't upgrade to v21 by accident (
-          # nextcloud20 throws an eval-error because it's dropped).
-          else if versionOlder stateVersion "21.03" then nextcloud20
           else if versionOlder stateVersion "21.11" then nextcloud21
           else if versionOlder stateVersion "22.05" then nextcloud22
           else nextcloud23