about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--nixos/doc/manual/release-notes/rl-2311.section.md3
-rw-r--r--nixos/modules/services/audio/slimserver.nix2
-rw-r--r--nixos/modules/services/databases/postgresql.md119
-rw-r--r--nixos/modules/services/databases/postgresql.nix58
-rw-r--r--nixos/modules/services/development/zammad.nix4
-rw-r--r--nixos/modules/services/finance/odoo.nix2
-rw-r--r--nixos/modules/services/mail/listmonk.nix2
-rw-r--r--nixos/modules/services/mail/roundcube.nix14
-rw-r--r--nixos/modules/services/mail/sympa.nix10
-rw-r--r--nixos/modules/services/matrix/matrix-sliding-sync.nix4
-rw-r--r--nixos/modules/services/matrix/mautrix-facebook.nix4
-rw-r--r--nixos/modules/services/misc/atuin.nix4
-rw-r--r--nixos/modules/services/misc/forgejo.nix10
-rw-r--r--nixos/modules/services/misc/gitea.nix10
-rw-r--r--nixos/modules/services/misc/redmine.nix4
-rw-r--r--nixos/modules/services/misc/sourcehut/service.nix10
-rw-r--r--nixos/modules/services/monitoring/zabbix-proxy.nix4
-rw-r--r--nixos/modules/services/monitoring/zabbix-server.nix4
-rw-r--r--nixos/modules/services/networking/syncthing.nix4
-rw-r--r--nixos/modules/services/security/hockeypuck.nix2
-rw-r--r--nixos/modules/services/web-apps/coder.nix10
-rw-r--r--nixos/modules/services/web-apps/gotosocial.nix4
-rw-r--r--nixos/modules/services/web-apps/invidious.nix15
-rw-r--r--nixos/modules/services/web-apps/jitsi-meet.nix178
-rw-r--r--nixos/modules/services/web-apps/lemmy.nix2
-rw-r--r--nixos/modules/services/web-apps/mastodon.nix6
-rw-r--r--nixos/modules/services/web-apps/mediawiki.nix4
-rw-r--r--nixos/modules/services/web-apps/miniflux.nix17
-rw-r--r--nixos/modules/services/web-apps/mobilizon.nix13
-rw-r--r--nixos/modules/services/web-apps/moodle.nix4
-rw-r--r--nixos/modules/services/web-apps/netbox.nix4
-rw-r--r--nixos/modules/services/web-apps/nextcloud.nix2
-rw-r--r--nixos/modules/services/web-apps/onlyoffice.nix2
-rw-r--r--nixos/modules/services/web-apps/outline.nix2
-rw-r--r--nixos/modules/services/web-apps/peering-manager.nix4
-rw-r--r--nixos/modules/services/web-apps/pixelfed.nix1
-rw-r--r--nixos/modules/services/web-apps/tt-rss.nix13
-rw-r--r--nixos/modules/services/web-servers/hydron.nix2
-rw-r--r--nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py17
-rw-r--r--nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix2
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/dex-oidc.nix2
-rw-r--r--nixos/tests/ferretdb.nix2
-rw-r--r--nixos/tests/freshrss-pgsql.nix4
-rw-r--r--nixos/tests/grafana/basic.nix2
-rw-r--r--nixos/tests/hockeypuck.nix2
-rw-r--r--nixos/tests/home-assistant.nix12
-rw-r--r--nixos/tests/invidious.nix3
-rw-r--r--nixos/tests/paperless.nix2
-rw-r--r--nixos/tests/pgadmin4.nix8
-rw-r--r--nixos/tests/pgbouncer.nix10
-rw-r--r--nixos/tests/powerdns-admin.nix4
-rw-r--r--nixos/tests/sftpgo.nix2
-rw-r--r--nixos/tests/slimserver.nix47
-rw-r--r--nixos/tests/systemd-boot.nix45
-rw-r--r--nixos/tests/tandoor-recipes.nix23
-rw-r--r--nixos/tests/vikunja.nix2
-rw-r--r--nixos/tests/wiki-js.nix5
-rw-r--r--pkgs/applications/audio/squeezelite/default.nix6
-rw-r--r--pkgs/applications/emulators/firebird-emu/default.nix28
-rw-r--r--pkgs/applications/graphics/hydrus/default.nix4
-rw-r--r--pkgs/applications/networking/browsers/chromium/upstream-info.nix16
-rw-r--r--pkgs/applications/networking/mailreaders/mailspring/default.nix5
-rw-r--r--pkgs/applications/version-management/gitlab/default.nix4
-rw-r--r--pkgs/applications/window-managers/leftwm/default.nix27
-rw-r--r--pkgs/by-name/cy/cyme/package.nix6
-rw-r--r--pkgs/by-name/no/nom/package.nix4
-rw-r--r--pkgs/by-name/py/pyprland/package.nix4
-rw-r--r--pkgs/by-name/wo/wordlists/package.nix57
-rw-r--r--pkgs/development/compilers/llvm/5/clang/LLVMgold-path.patch14
-rw-r--r--pkgs/development/compilers/llvm/5/clang/default.nix127
-rw-r--r--pkgs/development/compilers/llvm/5/clang/gnu-install-dirs.patch242
-rw-r--r--pkgs/development/compilers/llvm/5/compiler-rt/armv7l.patch23
-rw-r--r--pkgs/development/compilers/llvm/5/compiler-rt/codesign.patch155
-rw-r--r--pkgs/development/compilers/llvm/5/compiler-rt/compiler-rt-5-cstddef.patch10
-rw-r--r--pkgs/development/compilers/llvm/5/compiler-rt/default.nix112
-rw-r--r--pkgs/development/compilers/llvm/5/compiler-rt/gnu-install-dirs.patch103
-rw-r--r--pkgs/development/compilers/llvm/5/compiler-rt/sys-ustat.patch58
-rw-r--r--pkgs/development/compilers/llvm/5/default.nix140
-rw-r--r--pkgs/development/compilers/llvm/5/libcxx/default.nix79
-rw-r--r--pkgs/development/compilers/llvm/5/libcxx/gnu-install-dirs.patch72
-rw-r--r--pkgs/development/compilers/llvm/5/libcxxabi/default.nix70
-rw-r--r--pkgs/development/compilers/llvm/5/libcxxabi/gnu-install-dirs.patch28
-rw-r--r--pkgs/development/compilers/llvm/5/lld/default.nix46
-rw-r--r--pkgs/development/compilers/llvm/5/lld/gnu-install-dirs.patch68
-rw-r--r--pkgs/development/compilers/llvm/5/lldb/default.nix88
-rw-r--r--pkgs/development/compilers/llvm/5/lldb/gnu-install-dirs.patch76
-rw-r--r--pkgs/development/compilers/llvm/5/llvm/default.nix283
-rw-r--r--pkgs/development/compilers/llvm/5/llvm/fix-gcc9.patch33
-rw-r--r--pkgs/development/compilers/llvm/5/llvm/gnu-install-dirs-polly.patch106
-rw-r--r--pkgs/development/compilers/llvm/5/llvm/gnu-install-dirs.patch386
-rw-r--r--pkgs/development/compilers/llvm/5/openmp/default.nix37
-rw-r--r--pkgs/development/embedded/blisp/default.nix3
-rw-r--r--pkgs/development/interpreters/python/python2/mk-python-derivation.nix3
-rw-r--r--pkgs/development/interpreters/ruby/default.nix18
-rw-r--r--pkgs/development/libraries/shapelib/default.nix2
-rw-r--r--pkgs/development/python-modules/acquire/default.nix4
-rw-r--r--pkgs/development/python-modules/bbox/default.nix27
-rw-r--r--pkgs/development/python-modules/bork/default.nix16
-rw-r--r--pkgs/development/python-modules/brian2/default.nix6
-rw-r--r--pkgs/development/python-modules/brian2/numpy1.24.patch18
-rw-r--r--pkgs/development/python-modules/dissect-fat/default.nix4
-rw-r--r--pkgs/development/python-modules/dissect-hypervisor/default.nix4
-rw-r--r--pkgs/development/python-modules/dissect-regf/default.nix4
-rw-r--r--pkgs/development/python-modules/dissect-sql/default.nix4
-rw-r--r--pkgs/development/python-modules/flow-record/default.nix4
-rw-r--r--pkgs/development/python-modules/glances-api/default.nix8
-rw-r--r--pkgs/development/python-modules/llm/001-disable-install-uninstall-commands.patch34
-rw-r--r--pkgs/development/python-modules/llm/default.nix107
-rw-r--r--pkgs/development/python-modules/owslib/default.nix6
-rw-r--r--pkgs/development/python-modules/pyudev/default.nix19
-rw-r--r--pkgs/development/python-modules/sqids/default.nix4
-rw-r--r--pkgs/development/web/mailcatcher/default.nix4
-rw-r--r--pkgs/os-specific/darwin/skhd/default.nix2
-rw-r--r--pkgs/servers/dendrite/default.nix14
-rw-r--r--pkgs/servers/http/unit/default.nix3
-rw-r--r--pkgs/servers/jitsi-excalidraw/default.nix40
-rw-r--r--pkgs/servers/matrix-synapse/default.nix3
-rw-r--r--pkgs/servers/nextcloud/packages/26.json78
-rw-r--r--pkgs/servers/nextcloud/packages/27.json78
-rw-r--r--pkgs/servers/nextcloud/packages/nextcloud-apps.json2
-rw-r--r--pkgs/servers/slimserver/default.nix112
-rw-r--r--pkgs/test/default.nix1
-rw-r--r--pkgs/tools/filesystems/bcachefs-tools/default.nix36
-rw-r--r--pkgs/tools/misc/bootspec/default.nix12
-rw-r--r--pkgs/tools/package-management/xbps/default.nix17
-rw-r--r--pkgs/top-level/aliases.nix1
-rw-r--r--pkgs/top-level/all-packages.nix28
-rw-r--r--pkgs/top-level/perl-packages.nix66
-rw-r--r--pkgs/top-level/pkg-config/pkg-config-data.json5
-rw-r--r--pkgs/top-level/python-packages.nix2
-rw-r--r--pkgs/top-level/release.nix6
132 files changed, 1301 insertions, 2773 deletions
diff --git a/nixos/doc/manual/release-notes/rl-2311.section.md b/nixos/doc/manual/release-notes/rl-2311.section.md
index c00f60107fc7..d12695e20dea 100644
--- a/nixos/doc/manual/release-notes/rl-2311.section.md
+++ b/nixos/doc/manual/release-notes/rl-2311.section.md
@@ -145,6 +145,9 @@
 
 ## Backward Incompatibilities {#sec-release-23.11-incompatibilities}
 
+- `services.postgresql.ensurePermissions` has been deprecated in favor of `services.postgresql.ensureUsers.*.ensureDBOwnership` which simplifies the setup of database owned by a certain system user
+  in local database contexts (which make use of peer authentication via UNIX sockets), migration guidelines were provided in the NixOS manual, please refer to them if you are affected by a PostgreSQL 15 changing the way `GRANT ALL PRIVILEGES` is working. `services.postgresql.ensurePermissions` will be removed in 24.05. All NixOS modules were migrated using one of the strategy, e.g. `ensureDBOwnership` or `postStart`. More about this situation can be learnt in https://github.com/NixOS/nixpkgs/pull/266270.
+
 - `network-online.target` has been fixed to no longer time out for systems with `networking.useDHCP = true` and `networking.useNetworkd = true`.
   Workarounds for this can be removed.
 
diff --git a/nixos/modules/services/audio/slimserver.nix b/nixos/modules/services/audio/slimserver.nix
index 9fbc68b71364..cdd9d551c501 100644
--- a/nixos/modules/services/audio/slimserver.nix
+++ b/nixos/modules/services/audio/slimserver.nix
@@ -54,7 +54,7 @@ in {
       serviceConfig = {
         User = "slimserver";
         # Issue 40589: Disable broken image/video support (audio still works!)
-        ExecStart = "${cfg.package}/slimserver.pl --logdir ${cfg.dataDir}/logs --prefsdir ${cfg.dataDir}/prefs --cachedir ${cfg.dataDir}/cache --noimage --novideo";
+        ExecStart = "${lib.getExe cfg.package} --logdir ${cfg.dataDir}/logs --prefsdir ${cfg.dataDir}/prefs --cachedir ${cfg.dataDir}/cache --noimage --novideo";
       };
     };
 
diff --git a/nixos/modules/services/databases/postgresql.md b/nixos/modules/services/databases/postgresql.md
index d65d9616e2f2..e5e0b7efec29 100644
--- a/nixos/modules/services/databases/postgresql.md
+++ b/nixos/modules/services/databases/postgresql.md
@@ -39,6 +39,125 @@ By default, PostgreSQL stores its databases in {file}`/var/lib/postgresql/$psqlS
 services.postgresql.dataDir = "/data/postgresql";
 ```
 
+## Initializing {#module-services-postgres-initializing}
+
+As of NixOS 23.11,
+`services.postgresql.ensureUsers.*.ensurePermissions` has been
+deprecated, after a change to default permissions in PostgreSQL 15
+invalidated most of its previous use cases:
+
+- In psql < 15, `ALL PRIVILEGES` used to include `CREATE TABLE`, where
+  in psql >= 15 that would be a separate permission
+- psql >= 15 instead gives only the database owner create permissions
+- Even on psql < 15 (or databases migrated to >= 15), it is
+  recommended to manually assign permissions along these lines
+  - https://www.postgresql.org/docs/release/15.0/
+  - https://www.postgresql.org/docs/15/ddl-schemas.html#DDL-SCHEMAS-PRIV
+
+### Assigning ownership {#module-services-postgres-initializing-ownership}
+
+Usually, the database owner should be a database user of the same
+name. This can be done with
+`services.postgresql.ensureUsers.*.ensureDBOwnership = true;`.
+
+If the database user name equals the connecting system user name,
+postgres by default will accept a passwordless connection via unix
+domain socket. This makes it possible to run many postgres-backed
+services without creating any database secrets at all
+
+### Assigning extra permissions {#module-services-postgres-initializing-extra-permissions}
+
+For many cases, it will be enough to have the database user be the
+owner. Until `services.postgresql.ensureUsers.*.ensurePermissions` has
+been re-thought, if more users need access to the database, please use
+one of the following approaches:
+
+**WARNING:** `services.postgresql.initialScript` is not recommended
+for `ensurePermissions` replacement, as that is *only run on first
+start of PostgreSQL*.
+
+**NOTE:** all of these methods may be obsoleted, when `ensure*` is
+reworked, but it is expected that they will stay viable for running
+database migrations.
+
+**NOTE:** please make sure that any added migrations are idempotent (re-runnable).
+
+#### as superuser {#module-services-postgres-initializing-extra-permissions-superuser}
+
+**Advantage:** compatible with postgres < 15, because it's run
+as the database superuser `postgres`.
+
+##### in database `postStart` {#module-services-postgres-initializing-extra-permissions-superuser-post-start}
+
+**Disadvantage:** need to take care of ordering yourself. In this
+example, `mkAfter` ensures that permissions are assigned after any
+databases from `ensureDatabases` and `extraUser1` from `ensureUsers`
+are already created.
+
+```nix
+    systemd.services.postgresql.postStart = lib.mkAfter ''
+      $PSQL service1 -c 'GRANT SELECT ON ALL TABLES IN SCHEMA public TO "extraUser1"'
+      $PSQL service1 -c 'GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO "extraUser1"'
+      # ....
+    '';
+```
+
+##### in intermediate oneshot service {#module-services-postgres-initializing-extra-permissions-superuser-oneshot}
+
+```nix
+    systemd.services."migrate-service1-db1" = {
+      serviceConfig.Type = "oneshot";
+      requiredBy = "service1.service";
+      before = "service1.service";
+      after = "postgresql.service";
+      serviceConfig.User = "postgres";
+      environment.PSQL = "psql --port=${toString services.postgresql.port}";
+      path = [ postgresql ];
+      script = ''
+        $PSQL service1 -c 'GRANT SELECT ON ALL TABLES IN SCHEMA public TO "extraUser1"'
+        $PSQL service1 -c 'GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO "extraUser1"'
+        # ....
+      '';
+    };
+```
+
+#### as service user {#module-services-postgres-initializing-extra-permissions-service-user}
+
+**Advantage:** re-uses systemd's dependency ordering;
+
+**Disadvantage:** relies on service user having grant permission. To be combined with `ensureDBOwnership`.
+
+##### in service `preStart` {#module-services-postgres-initializing-extra-permissions-service-user-pre-start}
+
+```nix
+    environment.PSQL = "psql --port=${toString services.postgresql.port}";
+    path = [ postgresql ];
+    systemd.services."service1".preStart = ''
+      $PSQL -c 'GRANT SELECT ON ALL TABLES IN SCHEMA public TO "extraUser1"'
+      $PSQL -c 'GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO "extraUser1"'
+      # ....
+    '';
+```
+
+##### in intermediate oneshot service {#module-services-postgres-initializing-extra-permissions-service-user-oneshot}
+
+```nix
+    systemd.services."migrate-service1-db1" = {
+      serviceConfig.Type = "oneshot";
+      requiredBy = "service1.service";
+      before = "service1.service";
+      after = "postgresql.service";
+      serviceConfig.User = "service1";
+      environment.PSQL = "psql --port=${toString services.postgresql.port}";
+      path = [ postgresql ];
+      script = ''
+        $PSQL -c 'GRANT SELECT ON ALL TABLES IN SCHEMA public TO "extraUser1"'
+        $PSQL -c 'GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO "extraUser1"'
+        # ....
+      '';
+    };
+```
+
 ## Upgrading {#module-services-postgres-upgrading}
 
 ::: {.note}
diff --git a/nixos/modules/services/databases/postgresql.nix b/nixos/modules/services/databases/postgresql.nix
index af4db5c9611f..a9067d5974a9 100644
--- a/nixos/modules/services/databases/postgresql.nix
+++ b/nixos/modules/services/databases/postgresql.nix
@@ -168,7 +168,12 @@ in
             ensurePermissions = mkOption {
               type = types.attrsOf types.str;
               default = {};
+              visible = false; # This option has been deprecated.
               description = lib.mdDoc ''
+                This option is DEPRECATED and should not be used in nixpkgs anymore,
+                use `ensureDBOwnership` instead. It can also break with newer
+                versions of PostgreSQL (β‰₯Β 15).
+
                 Permissions to ensure for the user, specified as an attribute set.
                 The attribute names specify the database and tables to grant the permissions for.
                 The attribute values specify the permissions to grant. You may specify one or
@@ -187,6 +192,16 @@ in
               '';
             };
 
+            ensureDBOwnership = mkOption {
+              type = types.bool;
+              default = false;
+              description = mdDoc ''
+                Grants the user ownership to a database with the same name.
+                This database must be defined manually in
+                [](#opt-services.postgresql.ensureDatabases).
+              '';
+            };
+
             ensureClauses = mkOption {
               description = lib.mdDoc ''
                 An attrset of clauses to grant to the user. Under the hood this uses the
@@ -338,26 +353,21 @@ in
         });
         default = [];
         description = lib.mdDoc ''
-          Ensures that the specified users exist and have at least the ensured permissions.
+          Ensures that the specified users exist.
           The PostgreSQL users will be identified using peer authentication. This authenticates the Unix user with the
           same name only, and that without the need for a password.
-          This option will never delete existing users or remove permissions, especially not when the value of this
-          option is changed. This means that users created and permissions assigned once through this option or
-          otherwise have to be removed manually.
+          This option will never delete existing users or remove DB ownership of databases
+          once granted with `ensureDBOwnership = true;`. This means that this must be
+          cleaned up manually when changing after changing the config in here.
         '';
         example = literalExpression ''
           [
             {
               name = "nextcloud";
-              ensurePermissions = {
-                "DATABASE nextcloud" = "ALL PRIVILEGES";
-              };
             }
             {
               name = "superuser";
-              ensurePermissions = {
-                "ALL TABLES IN SCHEMA public" = "ALL PRIVILEGES";
-              };
+              ensureDBOwnership = true;
             }
           ]
         '';
@@ -445,6 +455,27 @@ in
 
   config = mkIf cfg.enable {
 
+    assertions = map ({ name, ensureDBOwnership, ... }: {
+      assertion = ensureDBOwnership -> builtins.elem name cfg.ensureDatabases;
+      message = ''
+        For each database user defined with `services.postgresql.ensureUsers` and
+        `ensureDBOwnership = true;`, a database with the same name must be defined
+        in `services.postgresql.ensureDatabases`.
+
+        Offender: ${name} has not been found among databases.
+      '';
+    }) cfg.ensureUsers;
+    # `ensurePermissions` is now deprecated, let's avoid it.
+    warnings = lib.optional (any ({ ensurePermissions, ... }: ensurePermissions != {}) cfg.ensureUsers) "
+      `services.postgresql.*.ensurePermissions` is used in your expressions,
+      this option is known to be broken with newer PostgreSQL versions,
+      consider migrating to `services.postgresql.*.ensureDBOwnership` or
+      consult the release notes or manual for more migration guidelines.
+
+      This option will be removed in NixOS 24.05 unless it sees significant
+      maintenance improvements.
+    ";
+
     services.postgresql.settings =
       {
         hba_file = "${pkgs.writeText "pg_hba.conf" cfg.authentication}";
@@ -556,12 +587,15 @@ in
             ${
               concatMapStrings
               (user:
-                let
+              let
                   userPermissions = concatStringsSep "\n"
                     (mapAttrsToList
                       (database: permission: ''$PSQL -tAc 'GRANT ${permission} ON ${database} TO "${user.name}"' '')
                       user.ensurePermissions
                     );
+                  dbOwnershipStmt = optionalString
+                    user.ensureDBOwnership
+                    ''$PSQL -tAc 'ALTER DATABASE "${user.name}" OWNER TO "${user.name}";' '';
 
                   filteredClauses = filterAttrs (name: value: value != null) user.ensureClauses;
 
@@ -572,6 +606,8 @@ in
                   $PSQL -tAc "SELECT 1 FROM pg_roles WHERE rolname='${user.name}'" | grep -q 1 || $PSQL -tAc 'CREATE USER "${user.name}"'
                   ${userPermissions}
                   ${userClauses}
+
+                  ${dbOwnershipStmt}
                 ''
               )
               cfg.ensureUsers
diff --git a/nixos/modules/services/development/zammad.nix b/nixos/modules/services/development/zammad.nix
index 7dd143eebf12..d24ed24ef395 100644
--- a/nixos/modules/services/development/zammad.nix
+++ b/nixos/modules/services/development/zammad.nix
@@ -204,7 +204,7 @@ in
 
     assertions = [
       {
-        assertion = cfg.database.createLocally -> cfg.database.user == "zammad";
+        assertion = cfg.database.createLocally -> cfg.database.user == "zammad" && cfg.database.name == "zammad";
         message = "services.zammad.database.user must be set to \"zammad\" if services.zammad.database.createLocally is set to true";
       }
       {
@@ -231,7 +231,7 @@ in
       ensureUsers = [
         {
           name = cfg.database.user;
-          ensurePermissions = { "DATABASE ${cfg.database.name}" = "ALL PRIVILEGES"; };
+          ensureDBOwnership = true;
         }
       ];
     };
diff --git a/nixos/modules/services/finance/odoo.nix b/nixos/modules/services/finance/odoo.nix
index eec7c4e30cc4..b8574ed09af9 100644
--- a/nixos/modules/services/finance/odoo.nix
+++ b/nixos/modules/services/finance/odoo.nix
@@ -121,7 +121,7 @@ in
       ensureDatabases = [ "odoo" ];
       ensureUsers = [{
         name = "odoo";
-        ensurePermissions = { "DATABASE odoo" = "ALL PRIVILEGES"; };
+        ensureDBOwnership = true;
       }];
     };
   });
diff --git a/nixos/modules/services/mail/listmonk.nix b/nixos/modules/services/mail/listmonk.nix
index 11b2a5186229..cea1bc956081 100644
--- a/nixos/modules/services/mail/listmonk.nix
+++ b/nixos/modules/services/mail/listmonk.nix
@@ -168,7 +168,7 @@ in {
 
       ensureUsers = [{
         name = "listmonk";
-        ensurePermissions = { "DATABASE listmonk" = "ALL PRIVILEGES"; };
+        ensureDBOwnership = true;
       }];
 
       ensureDatabases = [ "listmonk" ];
diff --git a/nixos/modules/services/mail/roundcube.nix b/nixos/modules/services/mail/roundcube.nix
index 22a4e3c451ab..4e29f567ed92 100644
--- a/nixos/modules/services/mail/roundcube.nix
+++ b/nixos/modules/services/mail/roundcube.nix
@@ -179,14 +179,22 @@ in
       };
     };
 
+    assertions = [
+      {
+        assertion = localDB -> cfg.database.username == cfg.database.dbname;
+        message = ''
+          When setting up a DB and its owner user, the owner and the DB name must be
+          equal!
+        '';
+      }
+    ];
+
     services.postgresql = mkIf localDB {
       enable = true;
       ensureDatabases = [ cfg.database.dbname ];
       ensureUsers = [ {
         name = cfg.database.username;
-        ensurePermissions = {
-          "DATABASE ${cfg.database.username}" = "ALL PRIVILEGES";
-        };
+        ensureDBOwnership = true;
       } ];
     };
 
diff --git a/nixos/modules/services/mail/sympa.nix b/nixos/modules/services/mail/sympa.nix
index 7a5047b2bea5..04ae46f66eea 100644
--- a/nixos/modules/services/mail/sympa.nix
+++ b/nixos/modules/services/mail/sympa.nix
@@ -218,7 +218,7 @@ in
         default = null;
         example = "/run/keys/sympa-dbpassword";
         description = lib.mdDoc ''
-          A file containing the password for {option}`services.sympa.database.user`.
+          A file containing the password for {option}`services.sympa.database.name`.
         '';
       };
 
@@ -342,6 +342,7 @@ in
 
       db_type = cfg.database.type;
       db_name = cfg.database.name;
+      db_user = cfg.database.name;
     }
     // (optionalAttrs (cfg.database.host != null) {
       db_host = cfg.database.host;
@@ -355,9 +356,6 @@ in
     // (optionalAttrs (cfg.database.port != null) {
       db_port = cfg.database.port;
     })
-    // (optionalAttrs (cfg.database.user != null) {
-      db_user = cfg.database.user;
-    })
     // (optionalAttrs (cfg.mta.type == "postfix") {
       sendmail_aliases = "${dataDir}/sympa_transport";
       aliases_program  = "${pkgs.postfix}/bin/postmap";
@@ -393,7 +391,7 @@ in
     users.groups.${group} = {};
 
     assertions = [
-      { assertion = cfg.database.createLocally -> cfg.database.user == user;
+      { assertion = cfg.database.createLocally -> cfg.database.user == user && cfg.database.name == cfg.database.user;
         message = "services.sympa.database.user must be set to ${user} if services.sympa.database.createLocally is set to true";
       }
       { assertion = cfg.database.createLocally -> cfg.database.passwordFile == null;
@@ -579,7 +577,7 @@ in
       ensureDatabases = [ cfg.database.name ];
       ensureUsers = [
         { name = cfg.database.user;
-          ensurePermissions = { "DATABASE ${cfg.database.name}" = "ALL PRIVILEGES"; };
+          ensureDBOwnership = true;
         }
       ];
     };
diff --git a/nixos/modules/services/matrix/matrix-sliding-sync.nix b/nixos/modules/services/matrix/matrix-sliding-sync.nix
index 9807cde40919..84bb38f35aeb 100644
--- a/nixos/modules/services/matrix/matrix-sliding-sync.nix
+++ b/nixos/modules/services/matrix/matrix-sliding-sync.nix
@@ -74,9 +74,9 @@ in
     services.postgresql = lib.optionalAttrs cfg.createDatabase {
       enable = true;
       ensureDatabases = [ "matrix-sliding-sync" ];
-      ensureUsers = [ rec {
+      ensureUsers = [ {
         name = "matrix-sliding-sync";
-        ensurePermissions."DATABASE \"${name}\"" = "ALL PRIVILEGES";
+        ensureDBOwnership = true;
       } ];
     };
 
diff --git a/nixos/modules/services/matrix/mautrix-facebook.nix b/nixos/modules/services/matrix/mautrix-facebook.nix
index 671040500df8..d7cf024bb807 100644
--- a/nixos/modules/services/matrix/mautrix-facebook.nix
+++ b/nixos/modules/services/matrix/mautrix-facebook.nix
@@ -135,9 +135,7 @@ in {
       ensureDatabases = ["mautrix-facebook"];
       ensureUsers = [{
         name = "mautrix-facebook";
-        ensurePermissions = {
-          "DATABASE \"mautrix-facebook\"" = "ALL PRIVILEGES";
-        };
+        ensureDBOwnership = true;
       }];
     };
 
diff --git a/nixos/modules/services/misc/atuin.nix b/nixos/modules/services/misc/atuin.nix
index 8d2c1b5242ff..2d6ffc510ce5 100644
--- a/nixos/modules/services/misc/atuin.nix
+++ b/nixos/modules/services/misc/atuin.nix
@@ -73,9 +73,7 @@ in
       enable = true;
       ensureUsers = [{
         name = "atuin";
-        ensurePermissions = {
-          "DATABASE atuin" = "ALL PRIVILEGES";
-        };
+        ensureDBOwnership = true;
       }];
       ensureDatabases = [ "atuin" ];
     };
diff --git a/nixos/modules/services/misc/forgejo.nix b/nixos/modules/services/misc/forgejo.nix
index e71e47b27f19..15966adfe38e 100644
--- a/nixos/modules/services/misc/forgejo.nix
+++ b/nixos/modules/services/misc/forgejo.nix
@@ -357,6 +357,14 @@ in
         assertion = cfg.database.createDatabase -> useSqlite || cfg.database.user == cfg.user;
         message = "services.forgejo.database.user must match services.forgejo.user if the database is to be automatically provisioned";
       }
+      { assertion = cfg.database.createDatabase && usePostgresql -> cfg.database.user == cfg.database.name;
+        message = ''
+          When creating a database via NixOS, the db user and db name must be equal!
+          If you already have an existing DB+user and this assertion is new, you can safely set
+          `services.forgejo.createDatabase` to `false` because removal of `ensureUsers`
+          and `ensureDatabases` doesn't have any effect.
+        '';
+      }
     ];
 
     services.forgejo.settings = {
@@ -423,7 +431,7 @@ in
       ensureUsers = [
         {
           name = cfg.database.user;
-          ensurePermissions = { "DATABASE ${cfg.database.name}" = "ALL PRIVILEGES"; };
+          ensureDBOwnership = true;
         }
       ];
     };
diff --git a/nixos/modules/services/misc/gitea.nix b/nixos/modules/services/misc/gitea.nix
index 3f690f85d623..be528a298991 100644
--- a/nixos/modules/services/misc/gitea.nix
+++ b/nixos/modules/services/misc/gitea.nix
@@ -394,6 +394,14 @@ in
       { assertion = cfg.database.createDatabase -> useSqlite || cfg.database.user == cfg.user;
         message = "services.gitea.database.user must match services.gitea.user if the database is to be automatically provisioned";
       }
+      { assertion = cfg.database.createDatabase && usePostgresql -> cfg.database.user == cfg.database.name;
+        message = ''
+          When creating a database via NixOS, the db user and db name must be equal!
+          If you already have an existing DB+user and this assertion is new, you can safely set
+          `services.gitea.createDatabase` to `false` because removal of `ensureUsers`
+          and `ensureDatabases` doesn't have any effect.
+        '';
+      }
     ];
 
     services.gitea.settings = {
@@ -461,7 +469,7 @@ in
       ensureDatabases = [ cfg.database.name ];
       ensureUsers = [
         { name = cfg.database.user;
-          ensurePermissions = { "DATABASE ${cfg.database.name}" = "ALL PRIVILEGES"; };
+          ensureDBOwnership = true;
         }
       ];
     };
diff --git a/nixos/modules/services/misc/redmine.nix b/nixos/modules/services/misc/redmine.nix
index a296fd3816bb..20fa71507b6b 100644
--- a/nixos/modules/services/misc/redmine.nix
+++ b/nixos/modules/services/misc/redmine.nix
@@ -267,7 +267,7 @@ in
       { assertion = cfg.database.passwordFile != null || cfg.database.socket != null;
         message = "one of services.redmine.database.socket or services.redmine.database.passwordFile must be set";
       }
-      { assertion = cfg.database.createLocally -> cfg.database.user == cfg.user;
+      { assertion = cfg.database.createLocally -> cfg.database.user == cfg.user && cfg.database.user == cfg.database.name;
         message = "services.redmine.database.user must be set to ${cfg.user} if services.redmine.database.createLocally is set true";
       }
       { assertion = cfg.database.createLocally -> cfg.database.socket != null;
@@ -315,7 +315,7 @@ in
       ensureDatabases = [ cfg.database.name ];
       ensureUsers = [
         { name = cfg.database.user;
-          ensurePermissions = { "DATABASE ${cfg.database.name}" = "ALL PRIVILEGES"; };
+          ensureDBOwnership = true;
         }
       ];
     };
diff --git a/nixos/modules/services/misc/sourcehut/service.nix b/nixos/modules/services/misc/sourcehut/service.nix
index 18c2f5effc5a..f08d5eb46871 100644
--- a/nixos/modules/services/misc/sourcehut/service.nix
+++ b/nixos/modules/services/misc/sourcehut/service.nix
@@ -249,10 +249,13 @@ in
       ensureDatabases = [ srvCfg.postgresql.database ];
       ensureUsers = map (name: {
           inherit name;
-          ensurePermissions = { "DATABASE \"${srvCfg.postgresql.database}\"" = "ALL PRIVILEGES"; };
+          # We don't use it because we have a special default database name with dots.
+          # TODO(for maintainers of sourcehut): migrate away from custom preStart script.
+          ensureDBOwnership = false;
         }) [srvCfg.user];
     };
 
+
     services.sourcehut.settings = mkMerge [
       {
         "${srv}.sr.ht".origin = mkDefault "https://${srv}.${cfg.settings."sr.ht".global-domain}";
@@ -378,10 +381,11 @@ in
         extraService
       ])) extraServices)
 
-      # Work around 'pq: permission denied for schema public' with postgres v15, until a
-      # solution for `services.postgresql.ensureUsers` is found.
+      # Work around 'pq: permission denied for schema public' with postgres v15.
       # See https://github.com/NixOS/nixpkgs/issues/216989
       # Workaround taken from nixos/forgejo: https://github.com/NixOS/nixpkgs/pull/262741
+      # TODO(to maintainers of sourcehut): please migrate away from this workaround
+      # by migrating away from database name defaults with dots.
       (lib.mkIf (
           cfg.postgresql.enable
           && lib.strings.versionAtLeast config.services.postgresql.package.version "15.0"
diff --git a/nixos/modules/services/monitoring/zabbix-proxy.nix b/nixos/modules/services/monitoring/zabbix-proxy.nix
index 85da416ba6c3..503e81b48a58 100644
--- a/nixos/modules/services/monitoring/zabbix-proxy.nix
+++ b/nixos/modules/services/monitoring/zabbix-proxy.nix
@@ -203,7 +203,7 @@ in
       { assertion = !config.services.zabbixServer.enable;
         message = "Please choose one of services.zabbixServer or services.zabbixProxy.";
       }
-      { assertion = cfg.database.createLocally -> cfg.database.user == user;
+      { assertion = cfg.database.createLocally -> cfg.database.user == user && cfg.database.name == cfg.database.user;
         message = "services.zabbixProxy.database.user must be set to ${user} if services.zabbixProxy.database.createLocally is set true";
       }
       { assertion = cfg.database.createLocally -> cfg.database.passwordFile == null;
@@ -252,7 +252,7 @@ in
       ensureDatabases = [ cfg.database.name ];
       ensureUsers = [
         { name = cfg.database.user;
-          ensurePermissions = { "DATABASE ${cfg.database.name}" = "ALL PRIVILEGES"; };
+          ensureDBOwnership = true;
         }
       ];
     };
diff --git a/nixos/modules/services/monitoring/zabbix-server.nix b/nixos/modules/services/monitoring/zabbix-server.nix
index 2b50280e3969..0607188d2131 100644
--- a/nixos/modules/services/monitoring/zabbix-server.nix
+++ b/nixos/modules/services/monitoring/zabbix-server.nix
@@ -191,7 +191,7 @@ in
   config = mkIf cfg.enable {
 
     assertions = [
-      { assertion = cfg.database.createLocally -> cfg.database.user == user;
+      { assertion = cfg.database.createLocally -> cfg.database.user == user && cfg.database.user == cfg.database.name;
         message = "services.zabbixServer.database.user must be set to ${user} if services.zabbixServer.database.createLocally is set true";
       }
       { assertion = cfg.database.createLocally -> cfg.database.passwordFile == null;
@@ -240,7 +240,7 @@ in
       ensureDatabases = [ cfg.database.name ];
       ensureUsers = [
         { name = cfg.database.user;
-          ensurePermissions = { "DATABASE ${cfg.database.name}" = "ALL PRIVILEGES"; };
+          ensureDBOwnership = true;
         }
       ];
     };
diff --git a/nixos/modules/services/networking/syncthing.nix b/nixos/modules/services/networking/syncthing.nix
index bdcdaf056d03..6d9af6141f12 100644
--- a/nixos/modules/services/networking/syncthing.nix
+++ b/nixos/modules/services/networking/syncthing.nix
@@ -666,7 +666,9 @@ in {
             ${cfg.package}/bin/syncthing \
               -no-browser \
               -gui-address=${if isUnixGui then "unix://" else ""}${cfg.guiAddress} \
-              -home=${cfg.configDir} ${escapeShellArgs cfg.extraFlags}
+              -config=${cfg.configDir} \
+              -data=${cfg.dataDir} \
+              ${escapeShellArgs cfg.extraFlags}
           '';
           MemoryDenyWriteExecute = true;
           NoNewPrivileges = true;
diff --git a/nixos/modules/services/security/hockeypuck.nix b/nixos/modules/services/security/hockeypuck.nix
index 127134bc5dba..56c13d791920 100644
--- a/nixos/modules/services/security/hockeypuck.nix
+++ b/nixos/modules/services/security/hockeypuck.nix
@@ -55,7 +55,7 @@ in {
             ensureDatabases = [ "hockeypuck" ];
             ensureUsers = [{
               name = "hockeypuck";
-              ensurePermissions."DATABASE hockeypuck" = "ALL PRIVILEGES";
+              ensureDBOwnership = true;
             }];
           };
         ```
diff --git a/nixos/modules/services/web-apps/coder.nix b/nixos/modules/services/web-apps/coder.nix
index 469a29bc3aa8..f65211308c40 100644
--- a/nixos/modules/services/web-apps/coder.nix
+++ b/nixos/modules/services/web-apps/coder.nix
@@ -149,8 +149,8 @@ in {
 
   config = mkIf cfg.enable {
     assertions = [
-      { assertion = cfg.database.createLocally -> cfg.database.username == name;
-        message = "services.coder.database.username must be set to ${user} if services.coder.database.createLocally is set true";
+      { assertion = cfg.database.createLocally -> cfg.database.username == name && cfg.database.database == cfg.database.username;
+        message = "services.coder.database.username must be set to ${name} if services.coder.database.createLocally is set true";
       }
     ];
 
@@ -193,10 +193,8 @@ in {
         cfg.database.database
       ];
       ensureUsers = [{
-        name = cfg.database.username;
-        ensurePermissions = {
-          "DATABASE \"${cfg.database.database}\"" = "ALL PRIVILEGES";
-        };
+        name = cfg.user;
+        ensureDBOwnership = true;
         }
       ];
     };
diff --git a/nixos/modules/services/web-apps/gotosocial.nix b/nixos/modules/services/web-apps/gotosocial.nix
index f7ae018d5b7c..9c21719a5759 100644
--- a/nixos/modules/services/web-apps/gotosocial.nix
+++ b/nixos/modules/services/web-apps/gotosocial.nix
@@ -128,9 +128,7 @@ in
       ensureUsers = [
         {
           name = "gotosocial";
-          ensurePermissions = {
-            "DATABASE gotosocial" = "ALL PRIVILEGES";
-          };
+          ensureDBOwnership = true;
         }
       ];
     };
diff --git a/nixos/modules/services/web-apps/invidious.nix b/nixos/modules/services/web-apps/invidious.nix
index 5603ef7392e8..e4fbc6fd9368 100644
--- a/nixos/modules/services/web-apps/invidious.nix
+++ b/nixos/modules/services/web-apps/invidious.nix
@@ -109,15 +109,17 @@ let
     # Default to using the local database if we create it
     services.invidious.database.host = lib.mkDefault null;
 
+
+    # TODO(raitobezarius to maintainers of invidious): I strongly advise to clean up the kemal specific
+    # thing for 24.05 and use `ensureDBOwnership`.
+    # See https://github.com/NixOS/nixpkgs/issues/216989
+    systemd.services.postgresql.postStart = lib.mkAfter ''
+      $PSQL -tAc 'ALTER DATABASE "${cfg.settings.db.dbname}" OWNER TO "${cfg.settings.db.user}";'
+    '';
     services.postgresql = {
       enable = true;
+      ensureUsers = lib.singleton { name = cfg.settings.db.user; ensureDBOwnership = false; };
       ensureDatabases = lib.singleton cfg.settings.db.dbname;
-      ensureUsers = lib.singleton {
-        name = cfg.settings.db.user;
-        ensurePermissions = {
-          "DATABASE ${cfg.settings.db.dbname}" = "ALL PRIVILEGES";
-        };
-      };
       # This is only needed because the unix user invidious isn't the same as
       # the database user. This tells postgres to map one to the other.
       identMap = ''
@@ -136,6 +138,7 @@ let
       documentation = [ "https://docs.invidious.io/Database-Information-and-Maintenance.md" ];
       startAt = lib.mkDefault "weekly";
       path = [ config.services.postgresql.package ];
+      after = [ "postgresql.service" ];
       script = ''
         psql ${cfg.settings.db.dbname} ${cfg.settings.db.user} -c "DELETE FROM nonces * WHERE expire < current_timestamp"
         psql ${cfg.settings.db.dbname} ${cfg.settings.db.user} -c "TRUNCATE TABLE videos"
diff --git a/nixos/modules/services/web-apps/jitsi-meet.nix b/nixos/modules/services/web-apps/jitsi-meet.nix
index 21416be35877..c0f9d785eea2 100644
--- a/nixos/modules/services/web-apps/jitsi-meet.nix
+++ b/nixos/modules/services/web-apps/jitsi-meet.nix
@@ -169,6 +169,15 @@ in
         off if you want to configure it manually.
       '';
     };
+
+    excalidraw.enable = mkEnableOption (lib.mdDoc "Excalidraw collaboration backend for Jitsi");
+    excalidraw.port = mkOption {
+      type = types.port;
+      default = 3002;
+      description = lib.mdDoc ''The port which the Excalidraw backend for Jitsi should listen to.'';
+    };
+
+    secureDomain.enable = mkEnableOption (lib.mdDoc "Authenticated room creation");
   };
 
   config = mkIf cfg.enable {
@@ -192,41 +201,118 @@ in
           roomLocking = false;
           roomDefaultPublicJids = true;
           extraConfig = ''
+            restrict_room_creation = true
+            storage = "memory"
+            admins = { "focus@auth.${cfg.hostName}" }
+          '';
+        }
+        {
+          domain = "breakout.${cfg.hostName}";
+          name = "Jitsi Meet Breakout MUC";
+          roomLocking = false;
+          roomDefaultPublicJids = true;
+          extraConfig = ''
+            restrict_room_creation = true
             storage = "memory"
+            admins = { "focus@auth.${cfg.hostName}" }
           '';
         }
         {
-          domain = "internal.${cfg.hostName}";
+          domain = "internal.auth.${cfg.hostName}";
           name = "Jitsi Meet Videobridge MUC";
+          roomLocking = false;
+          roomDefaultPublicJids = true;
           extraConfig = ''
             storage = "memory"
             admins = { "focus@auth.${cfg.hostName}", "jvb@auth.${cfg.hostName}" }
           '';
           #-- muc_room_cache_size = 1000
         }
+        {
+          domain = "lobby.${cfg.hostName}";
+          name = "Jitsi Meet Lobby MUC";
+          roomLocking = false;
+          roomDefaultPublicJids = true;
+          extraConfig = ''
+            restrict_room_creation = true
+            storage = "memory"
+          '';
+        }
+      ];
+      extraModules = [
+        "pubsub"
+        "smacks"
+        "speakerstats"
+        "external_services"
+        "conference_duration"
+        "end_conference"
+        "muc_lobby_rooms"
+        "muc_breakout_rooms"
+        "av_moderation"
+        "muc_hide_all"
+        "muc_meeting_id"
+        "muc_domain_mapper"
+        "muc_rate_limit"
+        "limits_exception"
+        "persistent_lobby"
+        "room_metadata"
       ];
-      extraModules = [ "pubsub" "smacks" ];
       extraPluginPaths = [ "${pkgs.jitsi-meet-prosody}/share/prosody-plugins" ];
-      extraConfig = lib.mkMerge [ (mkAfter ''
-        Component "focus.${cfg.hostName}" "client_proxy"
-          target_address = "focus@auth.${cfg.hostName}"
+      extraConfig = lib.mkMerge [
+        (mkAfter ''
+          Component "focus.${cfg.hostName}" "client_proxy"
+            target_address = "focus@auth.${cfg.hostName}"
+
+          Component "speakerstats.${cfg.hostName}" "speakerstats_component"
+            muc_component = "conference.${cfg.hostName}"
+
+          Component "conferenceduration.${cfg.hostName}" "conference_duration_component"
+            muc_component = "conference.${cfg.hostName}"
+
+          Component "endconference.${cfg.hostName}" "end_conference"
+            muc_component = "conference.${cfg.hostName}"
+
+          Component "avmoderation.${cfg.hostName}" "av_moderation_component"
+            muc_component = "conference.${cfg.hostName}"
+
+          Component "metadata.${cfg.hostName}" "room_metadata_component"
+            muc_component = "conference.${cfg.hostName}"
+            breakout_rooms_component = "breakout.${cfg.hostName}"
         '')
         (mkBefore ''
+          muc_mapper_domain_base = "${cfg.hostName}"
+
           cross_domain_websocket = true;
           consider_websocket_secure = true;
+
+          unlimited_jids = {
+            "focus@auth.${cfg.hostName}",
+            "jvb@auth.${cfg.hostName}"
+          }
         '')
       ];
       virtualHosts.${cfg.hostName} = {
         enabled = true;
         domain = cfg.hostName;
         extraConfig = ''
-          authentication = "anonymous"
+          authentication = ${if cfg.secureDomain.enable then "\"internal_hashed\"" else "\"jitsi-anonymous\""}
           c2s_require_encryption = false
           admins = { "focus@auth.${cfg.hostName}" }
           smacks_max_unacked_stanzas = 5
           smacks_hibernation_time = 60
           smacks_max_hibernated_sessions = 1
           smacks_max_old_sessions = 1
+
+          av_moderation_component = "avmoderation.${cfg.hostName}"
+          speakerstats_component = "speakerstats.${cfg.hostName}"
+          conference_duration_component = "conferenceduration.${cfg.hostName}"
+          end_conference_component = "endconference.${cfg.hostName}"
+
+          c2s_require_encryption = false
+          lobby_muc = "lobby.${cfg.hostName}"
+          breakout_rooms_muc = "breakout.${cfg.hostName}"
+          room_metadata_component = "metadata.${cfg.hostName}"
+          main_muc = "conference.${cfg.hostName}"
         '';
         ssl = {
           cert = "/var/lib/jitsi-meet/jitsi-meet.crt";
@@ -237,7 +323,7 @@ in
         enabled = true;
         domain = "auth.${cfg.hostName}";
         extraConfig = ''
-          authentication = "internal_plain"
+          authentication = "internal_hashed"
         '';
         ssl = {
           cert = "/var/lib/jitsi-meet/jitsi-meet.crt";
@@ -252,6 +338,14 @@ in
           c2s_require_encryption = false
         '';
       };
+      virtualHosts."guest.${cfg.hostName}" = {
+        enabled = true;
+        domain = "guest.${cfg.hostName}";
+        extraConfig = ''
+          authentication = "anonymous"
+          c2s_require_encryption = false
+        '';
+      };
     };
     systemd.services.prosody = mkIf cfg.prosody.enable {
       preStart = let
@@ -270,7 +364,7 @@ in
       reloadIfChanged = true;
     };
 
-    users.groups.jitsi-meet = {};
+    users.groups.jitsi-meet = { };
     systemd.tmpfiles.rules = [
       "d '/var/lib/jitsi-meet' 0750 root jitsi-meet - -"
     ];
@@ -317,6 +411,20 @@ in
       '';
     };
 
+    systemd.services.jitsi-excalidraw = mkIf cfg.excalidraw.enable {
+      description = "Excalidraw collaboration backend for Jitsi";
+      after = [ "network.target" ];
+      wantedBy = [ "multi-user.target" ];
+      environment.PORT = toString cfg.excalidraw.port;
+
+      serviceConfig = {
+        Type = "simple";
+        ExecStart = "${pkgs.jitsi-excalidraw}/bin/jitsi-excalidraw-backend";
+        Restart = "on-failure";
+        Group = "jitsi-meet";
+      };
+    };
+
     services.nginx = mkIf cfg.nginx.enable {
       enable = mkDefault true;
       virtualHosts.${cfg.hostName} = {
@@ -345,12 +453,23 @@ in
         locations."=/external_api.js" = mkDefault {
           alias = "${pkgs.jitsi-meet}/libs/external_api.min.js";
         };
+        locations."=/_api/room-info" = {
+          proxyPass = "http://localhost:5280/room-info";
+          extraConfig = ''
+            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+            proxy_set_header Host $host;
+          '';
+        };
         locations."=/config.js" = mkDefault {
           alias = overrideJs "${pkgs.jitsi-meet}/config.js" "config" (recursiveUpdate defaultCfg cfg.config) cfg.extraConfig;
         };
         locations."=/interface_config.js" = mkDefault {
           alias = overrideJs "${pkgs.jitsi-meet}/interface_config.js" "interfaceConfig" cfg.interfaceConfig "";
         };
+        locations."/socket.io/" = mkIf cfg.excalidraw.enable {
+          proxyPass = "http://127.0.0.1:${toString cfg.excalidraw.port}";
+          proxyWebsockets = true;
+        };
       };
     };
 
@@ -359,7 +478,7 @@ in
       virtualHosts.${cfg.hostName} = {
         extraConfig =
         let
-          templatedJitsiMeet = pkgs.runCommand "templated-jitsi-meet" {} ''
+          templatedJitsiMeet = pkgs.runCommand "templated-jitsi-meet" { } ''
             cp -R ${pkgs.jitsi-meet}/* .
             for file in *.html **/*.html ; do
               ${pkgs.sd}/bin/sd '<!--#include virtual="(.*)" -->' '{{ include "$1" }}' $file
@@ -390,13 +509,24 @@ in
       };
     };
 
+    services.jitsi-meet.config = recursiveUpdate
+      (mkIf cfg.excalidraw.enable {
+        whiteboard = {
+          enabled = true;
+          collabServerBaseUrl = "https://${cfg.hostName}";
+        };
+      })
+      (mkIf cfg.secureDomain.enable {
+        hosts.anonymousdomain = "guest.${cfg.hostName}";
+      });
+
     services.jitsi-videobridge = mkIf cfg.videobridge.enable {
       enable = true;
       xmppConfigs."localhost" = {
         userName = "jvb";
         domain = "auth.${cfg.hostName}";
         passwordFile = "/var/lib/jitsi-meet/videobridge-secret";
-        mucJids = "jvbbrewery@internal.${cfg.hostName}";
+        mucJids = "jvbbrewery@internal.auth.${cfg.hostName}";
         disableCertificateVerification = true;
       };
     };
@@ -409,17 +539,27 @@ in
       userName = "focus";
       userPasswordFile = "/var/lib/jitsi-meet/jicofo-user-secret";
       componentPasswordFile = "/var/lib/jitsi-meet/jicofo-component-secret";
-      bridgeMuc = "jvbbrewery@internal.${cfg.hostName}";
+      bridgeMuc = "jvbbrewery@internal.auth.${cfg.hostName}";
       config = mkMerge [{
         jicofo.xmpp.service.disable-certificate-verification = true;
         jicofo.xmpp.client.disable-certificate-verification = true;
-      #} (lib.mkIf cfg.jibri.enable {
-       } (lib.mkIf (config.services.jibri.enable || cfg.jibri.enable) {
-         jicofo.jibri = {
-           brewery-jid = "JibriBrewery@internal.${cfg.hostName}";
-           pending-timeout = "90";
-         };
-      })];
+      }
+        (lib.mkIf (config.services.jibri.enable || cfg.jibri.enable) {
+          jicofo.jibri = {
+            brewery-jid = "JibriBrewery@internal.auth.${cfg.hostName}";
+            pending-timeout = "90";
+          };
+        })
+        (lib.mkIf cfg.secureDomain.enable {
+          jicofo = {
+            authentication = {
+              enabled = "true";
+              type = "XMPP";
+              login-url = cfg.hostName;
+            };
+            xmpp.client.client-proxy = "focus.${cfg.hostName}";
+          };
+        })];
     };
 
     services.jibri = mkIf cfg.jibri.enable {
@@ -430,7 +570,7 @@ in
         xmppDomain = cfg.hostName;
 
         control.muc = {
-          domain = "internal.${cfg.hostName}";
+          domain = "internal.auth.${cfg.hostName}";
           roomName = "JibriBrewery";
           nickname = "jibri";
         };
diff --git a/nixos/modules/services/web-apps/lemmy.nix b/nixos/modules/services/web-apps/lemmy.nix
index 20d9dcb7c266..32389f7a59dd 100644
--- a/nixos/modules/services/web-apps/lemmy.nix
+++ b/nixos/modules/services/web-apps/lemmy.nix
@@ -146,7 +146,7 @@ in
         ensureDatabases = [ cfg.settings.database.database ];
         ensureUsers = [{
           name = cfg.settings.database.user;
-          ensurePermissions."DATABASE ${cfg.settings.database.database}" = "ALL PRIVILEGES";
+          ensureDBOwnership = true;
         }];
       };
 
diff --git a/nixos/modules/services/web-apps/mastodon.nix b/nixos/modules/services/web-apps/mastodon.nix
index d861f9e251be..8686506b1c28 100644
--- a/nixos/modules/services/web-apps/mastodon.nix
+++ b/nixos/modules/services/web-apps/mastodon.nix
@@ -612,7 +612,7 @@ in {
   config = lib.mkIf cfg.enable (lib.mkMerge [{
     assertions = [
       {
-        assertion = databaseActuallyCreateLocally -> (cfg.user == cfg.database.user);
+        assertion = databaseActuallyCreateLocally -> (cfg.user == cfg.database.user && cfg.database.user == cfg.database.name);
         message = ''
           For local automatic database provisioning (services.mastodon.database.createLocally == true) with peer
             authentication (services.mastodon.database.host == "/run/postgresql") to work services.mastodon.user
@@ -845,8 +845,8 @@ in {
       enable = true;
       ensureUsers = [
         {
-          name = cfg.database.user;
-          ensurePermissions."DATABASE ${cfg.database.name}" = "ALL PRIVILEGES";
+          name = cfg.database.name;
+          ensureDBOwnership = true;
         }
       ];
       ensureDatabases = [ cfg.database.name ];
diff --git a/nixos/modules/services/web-apps/mediawiki.nix b/nixos/modules/services/web-apps/mediawiki.nix
index 8b494b7c1208..ce7bcd94b3f0 100644
--- a/nixos/modules/services/web-apps/mediawiki.nix
+++ b/nixos/modules/services/web-apps/mediawiki.nix
@@ -454,7 +454,7 @@ in
       { assertion = cfg.database.createLocally -> (cfg.database.type == "mysql" || cfg.database.type == "postgres");
         message = "services.mediawiki.createLocally is currently only supported for database type 'mysql' and 'postgres'";
       }
-      { assertion = cfg.database.createLocally -> cfg.database.user == user;
+      { assertion = cfg.database.createLocally -> cfg.database.user == user && cfg.database.name == cfg.database.user;
         message = "services.mediawiki.database.user must be set to ${user} if services.mediawiki.database.createLocally is set true";
       }
       { assertion = cfg.database.createLocally -> cfg.database.socket != null;
@@ -486,7 +486,7 @@ in
       ensureDatabases = [ cfg.database.name ];
       ensureUsers = [{
         name = cfg.database.user;
-        ensurePermissions = { "DATABASE \"${cfg.database.name}\"" = "ALL PRIVILEGES"; };
+        ensureDBOwnership = true;
       }];
     };
 
diff --git a/nixos/modules/services/web-apps/miniflux.nix b/nixos/modules/services/web-apps/miniflux.nix
index 3374c746ad3d..5c8c93c13c43 100644
--- a/nixos/modules/services/web-apps/miniflux.nix
+++ b/nixos/modules/services/web-apps/miniflux.nix
@@ -6,13 +6,10 @@ let
 
   defaultAddress = "localhost:8080";
 
-  dbUser = "miniflux";
-  dbName = "miniflux";
-
   pgbin = "${config.services.postgresql.package}/bin";
   preStart = pkgs.writeScript "miniflux-pre-start" ''
     #!${pkgs.runtimeShell}
-    ${pgbin}/psql "${dbName}" -c "CREATE EXTENSION IF NOT EXISTS hstore"
+    ${pgbin}/psql "miniflux" -c "CREATE EXTENSION IF NOT EXISTS hstore"
   '';
 in
 
@@ -62,7 +59,7 @@ in
 
     services.miniflux.config =  {
       LISTEN_ADDR = mkDefault defaultAddress;
-      DATABASE_URL = "user=${dbUser} host=/run/postgresql dbname=${dbName}";
+      DATABASE_URL = "user=miniflux host=/run/postgresql dbname=miniflux";
       RUN_MIGRATIONS = "1";
       CREATE_ADMIN = "1";
     };
@@ -70,12 +67,10 @@ in
     services.postgresql = {
       enable = true;
       ensureUsers = [ {
-        name = dbUser;
-        ensurePermissions = {
-          "DATABASE ${dbName}" = "ALL PRIVILEGES";
-        };
+        name = "miniflux";
+        ensureDBOwnership = true;
       } ];
-      ensureDatabases = [ dbName ];
+      ensureDatabases = [ "miniflux" ];
     };
 
     systemd.services.miniflux-dbsetup = {
@@ -97,7 +92,7 @@ in
 
       serviceConfig = {
         ExecStart = "${cfg.package}/bin/miniflux";
-        User = dbUser;
+        User = "miniflux";
         DynamicUser = true;
         RuntimeDirectory = "miniflux";
         RuntimeDirectoryMode = "0700";
diff --git a/nixos/modules/services/web-apps/mobilizon.nix b/nixos/modules/services/web-apps/mobilizon.nix
index 343c5cead2b1..bb4319b51a2f 100644
--- a/nixos/modules/services/web-apps/mobilizon.nix
+++ b/nixos/modules/services/web-apps/mobilizon.nix
@@ -347,12 +347,18 @@ in
 
       # Taken from here:
       # https://framagit.org/framasoft/mobilizon/-/blob/1.1.0/priv/templates/setup_db.eex
+      # TODO(to maintainers of mobilizon): the owner database alteration is necessary
+      # as PostgreSQL 15 changed their behaviors w.r.t. to privileges.
+      # See https://github.com/NixOS/nixpkgs/issues/216989 to get rid
+      # of that workaround.
       script =
         ''
           psql "${repoSettings.database}" -c "\
             CREATE EXTENSION IF NOT EXISTS postgis; \
             CREATE EXTENSION IF NOT EXISTS pg_trgm; \
             CREATE EXTENSION IF NOT EXISTS unaccent;"
+          psql -tAc 'ALTER DATABASE "${repoSettings.database}" OWNER TO "${dbUser}";'
+
         '';
 
       serviceConfig = {
@@ -372,9 +378,10 @@ in
       ensureUsers = [
         {
           name = dbUser;
-          ensurePermissions = {
-            "DATABASE \"${repoSettings.database}\"" = "ALL PRIVILEGES";
-          };
+          # Given that `dbUser` is potentially arbitrarily custom, we will perform
+          # manual fixups in mobilizon-postgres.
+          # TODO(to maintainers of mobilizon): Feel free to simplify your setup by using `ensureDBOwnership`.
+          ensureDBOwnership = false;
         }
       ];
       extraPlugins = with postgresql.pkgs; [ postgis ];
diff --git a/nixos/modules/services/web-apps/moodle.nix b/nixos/modules/services/web-apps/moodle.nix
index b617e9a59379..04ae6bd7f175 100644
--- a/nixos/modules/services/web-apps/moodle.nix
+++ b/nixos/modules/services/web-apps/moodle.nix
@@ -194,7 +194,7 @@ in
   config = mkIf cfg.enable {
 
     assertions = [
-      { assertion = cfg.database.createLocally -> cfg.database.user == user;
+      { assertion = cfg.database.createLocally -> cfg.database.user == user && cfg.database.user == cfg.database.name;
         message = "services.moodle.database.user must be set to ${user} if services.moodle.database.createLocally is set true";
       }
       { assertion = cfg.database.createLocally -> cfg.database.passwordFile == null;
@@ -220,7 +220,7 @@ in
       ensureDatabases = [ cfg.database.name ];
       ensureUsers = [
         { name = cfg.database.user;
-          ensurePermissions = { "DATABASE ${cfg.database.name}" = "ALL PRIVILEGES"; };
+          ensureDBOwnership = true;
         }
       ];
     };
diff --git a/nixos/modules/services/web-apps/netbox.nix b/nixos/modules/services/web-apps/netbox.nix
index 8ba1852848e5..3b9434e3d345 100644
--- a/nixos/modules/services/web-apps/netbox.nix
+++ b/nixos/modules/services/web-apps/netbox.nix
@@ -257,9 +257,7 @@ in {
       ensureUsers = [
         {
           name = "netbox";
-          ensurePermissions = {
-            "DATABASE netbox" = "ALL PRIVILEGES";
-          };
+          ensureDBOwnership = true;
         }
       ];
     };
diff --git a/nixos/modules/services/web-apps/nextcloud.nix b/nixos/modules/services/web-apps/nextcloud.nix
index f9713cac47e9..f1ac3770d403 100644
--- a/nixos/modules/services/web-apps/nextcloud.nix
+++ b/nixos/modules/services/web-apps/nextcloud.nix
@@ -1042,7 +1042,7 @@ in {
         ensureDatabases = [ cfg.config.dbname ];
         ensureUsers = [{
           name = cfg.config.dbuser;
-          ensurePermissions = { "DATABASE ${cfg.config.dbname}" = "ALL PRIVILEGES"; };
+          ensureDBOwnership = true;
         }];
       };
 
diff --git a/nixos/modules/services/web-apps/onlyoffice.nix b/nixos/modules/services/web-apps/onlyoffice.nix
index 3494f2fa21f0..f958566b91f0 100644
--- a/nixos/modules/services/web-apps/onlyoffice.nix
+++ b/nixos/modules/services/web-apps/onlyoffice.nix
@@ -198,7 +198,7 @@ in
         ensureDatabases = [ "onlyoffice" ];
         ensureUsers = [{
           name = "onlyoffice";
-          ensurePermissions = { "DATABASE \"onlyoffice\"" = "ALL PRIVILEGES"; };
+          ensureDBOwnership = true;
         }];
       };
     };
diff --git a/nixos/modules/services/web-apps/outline.nix b/nixos/modules/services/web-apps/outline.nix
index 0e3bd07c1fc1..d97b45d62418 100644
--- a/nixos/modules/services/web-apps/outline.nix
+++ b/nixos/modules/services/web-apps/outline.nix
@@ -581,7 +581,7 @@ in
       enable = true;
       ensureUsers = [{
         name = "outline";
-        ensurePermissions."DATABASE outline" = "ALL PRIVILEGES";
+        ensureDBOwnership = true;
       }];
       ensureDatabases = [ "outline" ];
     };
diff --git a/nixos/modules/services/web-apps/peering-manager.nix b/nixos/modules/services/web-apps/peering-manager.nix
index 7012df6dffbf..d6f6077268d4 100644
--- a/nixos/modules/services/web-apps/peering-manager.nix
+++ b/nixos/modules/services/web-apps/peering-manager.nix
@@ -186,9 +186,7 @@ in {
       ensureUsers = [
         {
           name = "peering-manager";
-          ensurePermissions = {
-            "DATABASE \"peering-manager\"" = "ALL PRIVILEGES";
-          };
+          ensureDBOwnership = true;
         }
       ];
     };
diff --git a/nixos/modules/services/web-apps/pixelfed.nix b/nixos/modules/services/web-apps/pixelfed.nix
index 159fb52476aa..b0a25dcce9ef 100644
--- a/nixos/modules/services/web-apps/pixelfed.nix
+++ b/nixos/modules/services/web-apps/pixelfed.nix
@@ -271,7 +271,6 @@ in {
         ensureDatabases = [ cfg.database.name ];
         ensureUsers = [{
           name = user;
-          ensurePermissions = { };
         }];
       };
 
diff --git a/nixos/modules/services/web-apps/tt-rss.nix b/nixos/modules/services/web-apps/tt-rss.nix
index 7b2e3be4295e..a8fb37d2c5ec 100644
--- a/nixos/modules/services/web-apps/tt-rss.nix
+++ b/nixos/modules/services/web-apps/tt-rss.nix
@@ -529,6 +529,15 @@ let
         assertion = cfg.database.password != null -> cfg.database.passwordFile == null;
         message = "Cannot set both password and passwordFile";
       }
+      {
+        assertion = cfg.database.createLocally -> cfg.database.name == cfg.user && cfg.database.user == cfg.user;
+        message = ''
+          When creating a database via NixOS, the db user and db name must be equal!
+          If you already have an existing DB+user and this assertion is new, you can safely set
+          `services.tt-rss.database.createLocally` to `false` because removal of `ensureUsers`
+          and `ensureDatabases` doesn't have any effect.
+        '';
+      }
     ];
 
     services.phpfpm.pools = mkIf (cfg.pool == "${poolName}") {
@@ -632,8 +641,8 @@ let
       enable = mkDefault true;
       ensureDatabases = [ cfg.database.name ];
       ensureUsers = [
-        { name = cfg.user;
-          ensurePermissions = { "DATABASE ${cfg.database.name}" = "ALL PRIVILEGES"; };
+        { name = cfg.database.user;
+          ensureDBOwnership = true;
         }
       ];
     };
diff --git a/nixos/modules/services/web-servers/hydron.nix b/nixos/modules/services/web-servers/hydron.nix
index 4434965b217a..9d30fdc0caab 100644
--- a/nixos/modules/services/web-servers/hydron.nix
+++ b/nixos/modules/services/web-servers/hydron.nix
@@ -93,7 +93,7 @@ in with lib; {
       ensureDatabases = [ "hydron" ];
       ensureUsers = [
         { name = "hydron";
-          ensurePermissions = { "DATABASE hydron" = "ALL PRIVILEGES"; };
+          ensureDBOwnership = true;
         }
       ];
     };
diff --git a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py
index 96b42066b223..7d06e0131d9d 100644
--- a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py
+++ b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py
@@ -88,9 +88,20 @@ def write_loader_conf(profile: str | None, generation: int, specialisation: str
 
 
 def get_bootspec(profile: str | None, generation: int) -> BootSpec:
-    boot_json_path = os.path.realpath("%s/%s" % (system_dir(profile, generation, None), "boot.json"))
-    boot_json_f = open(boot_json_path, 'r')
-    bootspec_json = json.load(boot_json_f)
+    system_directory = system_dir(profile, generation, None)
+    boot_json_path = os.path.realpath("%s/%s" % (system_directory, "boot.json"))
+    if os.path.isfile(boot_json_path):
+        boot_json_f = open(boot_json_path, 'r')
+        bootspec_json = json.load(boot_json_f)
+    else:
+        boot_json_str = subprocess.check_output([
+        "@bootspecTools@/bin/synthesize",
+        "--version",
+        "1",
+        system_directory,
+        "/dev/stdout"],
+        universal_newlines=True)
+        bootspec_json = json.loads(boot_json_str)
     return bootspec_from_json(bootspec_json)
 
 def bootspec_from_json(bootspec_json: Dict) -> BootSpec:
diff --git a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix
index 1086ab80b14f..9d55c21077d1 100644
--- a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix
+++ b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix
@@ -16,6 +16,8 @@ let
 
     systemd = config.systemd.package;
 
+    bootspecTools = pkgs.bootspec;
+
     nix = config.nix.package.out;
 
     timeout = optionalString (config.boot.loader.timeout != null) config.boot.loader.timeout;
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 6a654b00d76c..325e99c97749 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -749,6 +749,7 @@ in {
   signal-desktop = handleTest ./signal-desktop.nix {};
   simple = handleTest ./simple.nix {};
   sing-box = handleTest ./sing-box.nix {};
+  slimserver = handleTest ./slimserver.nix {};
   slurm = handleTest ./slurm.nix {};
   smokeping = handleTest ./smokeping.nix {};
   snapcast = handleTest ./snapcast.nix {};
diff --git a/nixos/tests/dex-oidc.nix b/nixos/tests/dex-oidc.nix
index 37275a97ef0f..e54ae18ca937 100644
--- a/nixos/tests/dex-oidc.nix
+++ b/nixos/tests/dex-oidc.nix
@@ -49,7 +49,7 @@ import ./make-test-python.nix ({ lib, ... }: {
       ensureUsers = [
         {
           name = "dex";
-          ensurePermissions = { "DATABASE dex" = "ALL PRIVILEGES"; };
+          ensureDBOwnership = true;
         }
       ];
     };
diff --git a/nixos/tests/ferretdb.nix b/nixos/tests/ferretdb.nix
index 9ad7397ade80..7251198af77d 100644
--- a/nixos/tests/ferretdb.nix
+++ b/nixos/tests/ferretdb.nix
@@ -39,7 +39,7 @@ with import ../lib/testing-python.nix { inherit system; };
             ensureDatabases = [ "ferretdb" ];
             ensureUsers = [{
               name = "ferretdb";
-              ensurePermissions."DATABASE ferretdb" = "ALL PRIVILEGES";
+              ensureDBOwnership = true;
             }];
           };
 
diff --git a/nixos/tests/freshrss-pgsql.nix b/nixos/tests/freshrss-pgsql.nix
index 055bd51ed43d..c685f4a8159b 100644
--- a/nixos/tests/freshrss-pgsql.nix
+++ b/nixos/tests/freshrss-pgsql.nix
@@ -22,9 +22,7 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: {
       ensureUsers = [
         {
           name = "freshrss";
-          ensurePermissions = {
-            "DATABASE freshrss" = "ALL PRIVILEGES";
-          };
+          ensureDBOwnership = true;
         }
       ];
       initialScript = pkgs.writeText "postgresql-password" ''
diff --git a/nixos/tests/grafana/basic.nix b/nixos/tests/grafana/basic.nix
index 8bf4caad7fbf..dd389bc8a3d1 100644
--- a/nixos/tests/grafana/basic.nix
+++ b/nixos/tests/grafana/basic.nix
@@ -55,7 +55,7 @@ let
         ensureDatabases = [ "grafana" ];
         ensureUsers = [{
           name = "grafana";
-          ensurePermissions."DATABASE grafana" = "ALL PRIVILEGES";
+          ensureDBOwnership = true;
         }];
       };
       systemd.services.grafana.after = [ "postgresql.service" ];
diff --git a/nixos/tests/hockeypuck.nix b/nixos/tests/hockeypuck.nix
index 2b9dba8720ab..675d6b226ad2 100644
--- a/nixos/tests/hockeypuck.nix
+++ b/nixos/tests/hockeypuck.nix
@@ -35,7 +35,7 @@ in {
       ensureDatabases = [ "hockeypuck" ];
       ensureUsers = [{
         name = "hockeypuck";
-        ensurePermissions."DATABASE hockeypuck" = "ALL PRIVILEGES";
+        ensureDBOwnership = true;
       }];
     };
   };
diff --git a/nixos/tests/home-assistant.nix b/nixos/tests/home-assistant.nix
index e97e8a467b18..e1588088ba19 100644
--- a/nixos/tests/home-assistant.nix
+++ b/nixos/tests/home-assistant.nix
@@ -9,13 +9,11 @@ in {
   nodes.hass = { pkgs, ... }: {
     services.postgresql = {
       enable = true;
-
-      # FIXME: hack for https://github.com/NixOS/nixpkgs/issues/216989
-      # Should be replaced with ensureUsers again when a solution for that is found
-      initialScript = pkgs.writeText "hass-setup-db.sql" ''
-        CREATE ROLE hass WITH LOGIN;
-        CREATE DATABASE hass WITH OWNER hass;
-      '';
+      ensureDatabases = [ "hass" ];
+      ensureUsers = [{
+        name = "hass";
+        ensureDBOwnership = true;
+      }];
     };
 
     services.home-assistant = {
diff --git a/nixos/tests/invidious.nix b/nixos/tests/invidious.nix
index 582d1550fff1..701e8e5e7a3f 100644
--- a/nixos/tests/invidious.nix
+++ b/nixos/tests/invidious.nix
@@ -44,8 +44,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
             enable = true;
             initialScript = pkgs.writeText "init-postgres-with-password" ''
               CREATE USER kemal WITH PASSWORD 'correct horse battery staple';
-              CREATE DATABASE invidious;
-              GRANT ALL PRIVILEGES ON DATABASE invidious TO kemal;
+              CREATE DATABASE invidious OWNER kemal;
             '';
           };
       };
diff --git a/nixos/tests/paperless.nix b/nixos/tests/paperless.nix
index 22409e899236..6a51cc522bdc 100644
--- a/nixos/tests/paperless.nix
+++ b/nixos/tests/paperless.nix
@@ -17,7 +17,7 @@ import ./make-test-python.nix ({ lib, ... }: {
         ensureDatabases = [ "paperless" ];
         ensureUsers = [
           { name = config.services.paperless.user;
-            ensurePermissions = { "DATABASE \"paperless\"" = "ALL PRIVILEGES"; };
+            ensureDBOwnership = true;
           }
         ];
       };
diff --git a/nixos/tests/pgadmin4.nix b/nixos/tests/pgadmin4.nix
index cb8de87c9ee3..3ee7ed19fa1c 100644
--- a/nixos/tests/pgadmin4.nix
+++ b/nixos/tests/pgadmin4.nix
@@ -19,14 +19,6 @@ import ./make-test-python.nix ({ pkgs, lib, ... }:
       authentication = ''
         host    all             all             localhost               trust
       '';
-      ensureUsers = [
-        {
-          name = "postgres";
-          ensurePermissions = {
-            "DATABASE \"postgres\"" = "ALL PRIVILEGES";
-          };
-        }
-      ];
     };
 
     services.pgadmin = {
diff --git a/nixos/tests/pgbouncer.nix b/nixos/tests/pgbouncer.nix
index 1e72327d4200..bb5afd35ee28 100644
--- a/nixos/tests/pgbouncer.nix
+++ b/nixos/tests/pgbouncer.nix
@@ -17,7 +17,8 @@ in
 
       systemd.services.postgresql = {
         postStart = ''
-            ${pkgs.postgresql}/bin/psql -U postgres -c "ALTER ROLE testuser WITH LOGIN PASSWORD 'testpass'";
+          ${pkgs.postgresql}/bin/psql -U postgres -c "ALTER ROLE testuser WITH LOGIN PASSWORD 'testpass'";
+          ${pkgs.postgresql}/bin/psql -U postgres -c "ALTER DATABASE testdb OWNER TO testuser;";
         '';
       };
 
@@ -28,9 +29,6 @@ in
           ensureUsers = [
           {
             name = "testuser";
-            ensurePermissions = {
-              "DATABASE testdb" = "ALL PRIVILEGES";
-            };
           }];
           authentication = ''
             local testdb testuser scram-sha-256
@@ -40,7 +38,7 @@ in
         pgbouncer = {
           enable = true;
           listenAddress = "localhost";
-          databases = { testdb = "host=/run/postgresql/ port=5432 auth_user=testuser dbname=testdb"; };
+          databases = { test = "host=/run/postgresql/ port=5432 auth_user=testuser dbname=testdb"; };
           authType = "scram-sha-256";
           authFile = testAuthFile;
         };
@@ -55,7 +53,7 @@ in
 
     # Test if we can make a query through PgBouncer
     one.wait_until_succeeds(
-        "psql 'postgres://testuser:testpass@localhost:6432/testdb' -c 'SELECT 1;'"
+        "psql 'postgres://testuser:testpass@localhost:6432/test' -c 'SELECT 1;'"
     )
   '';
 })
diff --git a/nixos/tests/powerdns-admin.nix b/nixos/tests/powerdns-admin.nix
index d7bacb24eec5..d326d74a9826 100644
--- a/nixos/tests/powerdns-admin.nix
+++ b/nixos/tests/powerdns-admin.nix
@@ -87,9 +87,7 @@ let
           ensureUsers = [
             {
               name = "powerdnsadmin";
-              ensurePermissions = {
-                "DATABASE powerdnsadmin" = "ALL PRIVILEGES";
-              };
+              ensureDBOwnership = true;
             }
           ];
         };
diff --git a/nixos/tests/sftpgo.nix b/nixos/tests/sftpgo.nix
index db0098d2ac48..a5bb1981d2c3 100644
--- a/nixos/tests/sftpgo.nix
+++ b/nixos/tests/sftpgo.nix
@@ -156,7 +156,7 @@ in
         ensureDatabases = [ "sftpgo" ];
         ensureUsers = [{
           name = "sftpgo";
-          ensurePermissions."DATABASE sftpgo" = "ALL PRIVILEGES";
+          ensureDBOwnership = true;
         }];
       };
 
diff --git a/nixos/tests/slimserver.nix b/nixos/tests/slimserver.nix
new file mode 100644
index 000000000000..c3f7b6fde4de
--- /dev/null
+++ b/nixos/tests/slimserver.nix
@@ -0,0 +1,47 @@
+import ./make-test-python.nix ({ pkgs, ...} : {
+  name = "slimserver";
+  meta.maintainers = with pkgs.lib.maintainers; [ adamcstephens ];
+
+  nodes.machine = { ... }: {
+    services.slimserver.enable = true;
+    services.squeezelite = {
+      enable = true;
+      extraArguments = "-s 127.0.0.1 -d slimproto=info";
+    };
+    sound.enable = true;
+    boot.initrd.kernelModules = ["snd-dummy"];
+  };
+
+  testScript =
+    ''
+      import json
+      rpc_get_player = {
+          "id": 1,
+          "method": "slim.request",
+          "params":[0,["player", "id", "0", "?"]]
+      }
+
+      with subtest("slimserver is started"):
+          machine.wait_for_unit("slimserver.service")
+          # give slimserver a moment to report errors
+          machine.sleep(2)
+
+      with subtest('slimserver module errors are not reported'):
+          machine.fail("journalctl -u slimserver.service | grep 'throw_exception'")
+          machine.fail("journalctl -u slimserver.service | grep 'not installed'")
+          machine.fail("journalctl -u slimserver.service | grep 'not found'")
+          machine.fail("journalctl -u slimserver.service | grep 'The following CPAN modules were found but cannot work with Logitech Media Server'")
+          machine.fail("journalctl -u slimserver.service | grep 'please use the buildme.sh'")
+
+      with subtest('slimserver is ready'):
+          machine.wait_for_open_port(9000)
+          machine.wait_until_succeeds("journalctl -u slimserver.service | grep 'Completed dbOptimize Scan'")
+
+      with subtest("squeezelite player successfully connects to slimserver"):
+          machine.wait_for_unit("squeezelite.service")
+          machine.wait_until_succeeds("journalctl -u squeezelite.service | grep 'slimproto:937 connected'")
+          player_mac = machine.wait_until_succeeds("journalctl -eu squeezelite.service | grep 'sendHELO:148 mac:'").strip().split(" ")[-1]
+          player_id = machine.succeed(f"curl http://localhost:9000/jsonrpc.js -g -X POST -d '{json.dumps(rpc_get_player)}'")
+          assert player_mac == json.loads(player_id)["result"]["_id"], "squeezelite player not found"
+    '';
+})
diff --git a/nixos/tests/systemd-boot.nix b/nixos/tests/systemd-boot.nix
index 13007d0d80d8..256a18532b0a 100644
--- a/nixos/tests/systemd-boot.nix
+++ b/nixos/tests/systemd-boot.nix
@@ -252,6 +252,35 @@ in
     '';
   };
 
+  garbage-collect-entry = makeTest {
+    name = "systemd-boot-switch-test";
+    meta.maintainers = with pkgs.lib.maintainers; [ julienmalka ];
+
+    nodes = {
+      inherit common;
+      machine = { pkgs, nodes, ... }: {
+        imports = [ common ];
+
+        # These are configs for different nodes, but we'll use them here in `machine`
+        system.extraDependencies = [
+          nodes.common.system.build.toplevel
+        ];
+      };
+    };
+
+    testScript = { nodes, ... }:
+      let
+        baseSystem = nodes.common.system.build.toplevel;
+      in
+      ''
+        machine.succeed("nix-env -p /nix/var/nix/profiles/system --set ${baseSystem}")
+        machine.succeed("nix-env -p /nix/var/nix/profiles/system --delete-generations 1")
+        machine.succeed("${baseSystem}/bin/switch-to-configuration boot")
+        machine.fail("test -e /boot/loader/entries/nixos-generation-1.conf")
+        machine.succeed("test -e /boot/loader/entries/nixos-generation-2.conf")
+      '';
+  };
+
   # Some UEFI firmwares fail on large reads. Now that systemd-boot loads initrd
   # itself, systems with such firmware won't boot without this fix
   uefiLargeFileWorkaround = makeTest {
@@ -277,4 +306,20 @@ in
       machine.wait_for_unit("multi-user.target")
     '';
   };
+
+  no-bootspec = makeTest
+    {
+      name = "systemd-boot-no-bootspec";
+      meta.maintainers = with pkgs.lib.maintainers; [ julienmalka ];
+
+      nodes.machine = {
+        imports = [ common ];
+        boot.bootspec.enable = false;
+      };
+
+      testScript = ''
+        machine.start()
+        machine.wait_for_unit("multi-user.target")
+      '';
+    };
 }
diff --git a/nixos/tests/tandoor-recipes.nix b/nixos/tests/tandoor-recipes.nix
index f3369da99a05..18beaac6f062 100644
--- a/nixos/tests/tandoor-recipes.nix
+++ b/nixos/tests/tandoor-recipes.nix
@@ -5,6 +5,29 @@ import ./make-test-python.nix ({ lib, ... }: {
   nodes.machine = { pkgs, ... }: {
     services.tandoor-recipes = {
       enable = true;
+      extraConfig = {
+        DB_ENGINE = "django.db.backends.postgresql";
+        POSTGRES_HOST = "/run/postgresql";
+        POSTGRES_USER = "tandoor_recipes";
+        POSTGRES_DB = "tandoor_recipes";
+      };
+    };
+
+    services.postgresql = {
+      enable = true;
+      ensureDatabases = [ "tandoor_recipes" ];
+      ensureUsers = [
+        {
+          name = "tandoor_recipes";
+          ensureDBOwnership = true;
+        }
+      ];
+    };
+
+    systemd.services = {
+      tandoor-recipes = {
+        after = [ "postgresql.service" ];
+      };
     };
   };
 
diff --git a/nixos/tests/vikunja.nix b/nixos/tests/vikunja.nix
index 2660aa9767ca..60fd5ce13854 100644
--- a/nixos/tests/vikunja.nix
+++ b/nixos/tests/vikunja.nix
@@ -33,7 +33,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
         ensureDatabases = [ "vikunja-api" ];
         ensureUsers = [
           { name = "vikunja-api";
-            ensurePermissions = { "DATABASE \"vikunja-api\"" = "ALL PRIVILEGES"; };
+            ensureDBOwnership = true;
           }
         ];
       };
diff --git a/nixos/tests/wiki-js.nix b/nixos/tests/wiki-js.nix
index fd054a9c5909..8b3c51935a6c 100644
--- a/nixos/tests/wiki-js.nix
+++ b/nixos/tests/wiki-js.nix
@@ -10,14 +10,15 @@ import ./make-test-python.nix ({ pkgs, lib, ...} : {
       enable = true;
       settings.db.host = "/run/postgresql";
       settings.db.user = "wiki-js";
+      settings.db.db = "wiki-js";
       settings.logLevel = "debug";
     };
     services.postgresql = {
       enable = true;
-      ensureDatabases = [ "wiki" ];
+      ensureDatabases = [ "wiki-js" ];
       ensureUsers = [
         { name = "wiki-js";
-          ensurePermissions."DATABASE wiki" = "ALL PRIVILEGES";
+          ensureDBOwnership = true;
         }
       ];
     };
diff --git a/pkgs/applications/audio/squeezelite/default.nix b/pkgs/applications/audio/squeezelite/default.nix
index da126de3fc43..0f3b8be11c08 100644
--- a/pkgs/applications/audio/squeezelite/default.nix
+++ b/pkgs/applications/audio/squeezelite/default.nix
@@ -22,6 +22,7 @@
 , openssl
 , portaudioSupport ? stdenv.isDarwin
 , portaudio
+, slimserver
 , AudioToolbox
 , AudioUnit
 , Carbon
@@ -95,7 +96,10 @@ stdenv.mkDerivation {
     runHook postInstall
   '';
 
-  passthru.updateScript = ./update.sh;
+  passthru = {
+    inherit (slimserver) tests;
+    updateScript = ./update.sh;
+  };
 
   meta = with lib; {
     description = "Lightweight headless squeezebox client emulator";
diff --git a/pkgs/applications/emulators/firebird-emu/default.nix b/pkgs/applications/emulators/firebird-emu/default.nix
index d117a93fba4a..9fd990146161 100644
--- a/pkgs/applications/emulators/firebird-emu/default.nix
+++ b/pkgs/applications/emulators/firebird-emu/default.nix
@@ -1,6 +1,13 @@
-{ mkDerivation, lib, fetchFromGitHub, qmake, qtbase, qtdeclarative }:
-
-mkDerivation rec {
+{ stdenv
+, lib
+, fetchFromGitHub
+, qmake
+, qtbase
+, qtdeclarative
+, qtquickcontrols
+, wrapQtAppsHook
+}:
+stdenv.mkDerivation rec {
   pname = "firebird-emu";
   version = "1.6";
 
@@ -12,16 +19,23 @@ mkDerivation rec {
     hash = "sha256-ZptjlnOiF+hKuKYvBFJL95H5YQuR99d4biOco/MVEmE=";
   };
 
-  nativeBuildInputs = [ qmake ];
+  # work around https://github.com/NixOS/nixpkgs/issues/19098
+  env.NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.cc.isClang && stdenv.isDarwin) "-fno-lto";
+
+  nativeBuildInputs = [ wrapQtAppsHook qmake ];
+
+  buildInputs = [ qtbase qtdeclarative qtquickcontrols ];
 
-  buildInputs = [ qtbase qtdeclarative ];
+  postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
+    mkdir $out/Applications
+    mv $out/bin/${pname}.app $out/Applications/
+  '';
 
   meta = {
     homepage = "https://github.com/nspire-emus/firebird";
     description = "Third-party multi-platform emulator of the ARM-based TI-Nspireβ„’ calculators";
     license = lib.licenses.gpl3;
     maintainers = with lib.maintainers; [ pneumaticat ];
-    # Only tested on Linux, but likely possible to build on, e.g. macOS
-    platforms = lib.platforms.linux;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/applications/graphics/hydrus/default.nix b/pkgs/applications/graphics/hydrus/default.nix
index 0f96680bb073..8bddaa96abd5 100644
--- a/pkgs/applications/graphics/hydrus/default.nix
+++ b/pkgs/applications/graphics/hydrus/default.nix
@@ -12,14 +12,14 @@
 
 python3Packages.buildPythonPackage rec {
   pname = "hydrus";
-  version = "551";
+  version = "552";
   format = "other";
 
   src = fetchFromGitHub {
     owner = "hydrusnetwork";
     repo = "hydrus";
     rev = "refs/tags/v${version}";
-    hash = "sha256-P/U44ndfucbRnwGLdSnnA0VE4K40zPz3wtNpQj8rh5Q=";
+    hash = "sha256-MaS9WxYlbQ7V/2mrETKS0UyWb5IzCrSwDcp4UlVS3zk=";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/applications/networking/browsers/chromium/upstream-info.nix b/pkgs/applications/networking/browsers/chromium/upstream-info.nix
index 4714704c0e79..d11dce5a1051 100644
--- a/pkgs/applications/networking/browsers/chromium/upstream-info.nix
+++ b/pkgs/applications/networking/browsers/chromium/upstream-info.nix
@@ -15,9 +15,9 @@
         version = "2023-09-12";
       };
     };
-    hash = "sha256-UR8EowMYZ668qQ/6C9C/M+0HSguyUGKVhY46FTG+ShA=";
-    hash_deb_amd64 = "sha256-PIBWkCwU/7N242wR/WmpJDDJKLDGk/sJxPxa05bOQSE=";
-    version = "119.0.6045.123";
+    hash = "sha256-8xPm3vNF0HjfL7ewTz7iz7GMfiJi6mhMK1YSC7VeoSM=";
+    hash_deb_amd64 = "sha256-xAm7bPsnnJD7UWNTtHKMv5enHo3rM9w0M81QPqZVlP4=";
+    version = "119.0.6045.159";
   };
   ungoogled-chromium = {
     deps = {
@@ -28,12 +28,12 @@
         version = "2023-09-12";
       };
       ungoogled-patches = {
-        hash = "sha256-4EbfM62KuG8nHrYWwp183V5G9ac7FICjpyJahnKbQjE=";
-        rev = "119.0.6045.123-1";
+        hash = "sha256-kgUrYXy2avfwfRckSYI6YPMW1uuvl2Osg4Vr9Q1ksMc=";
+        rev = "119.0.6045.159-1";
       };
     };
-    hash = "sha256-UR8EowMYZ668qQ/6C9C/M+0HSguyUGKVhY46FTG+ShA=";
-    hash_deb_amd64 = "sha256-PIBWkCwU/7N242wR/WmpJDDJKLDGk/sJxPxa05bOQSE=";
-    version = "119.0.6045.123";
+    hash = "sha256-8xPm3vNF0HjfL7ewTz7iz7GMfiJi6mhMK1YSC7VeoSM=";
+    hash_deb_amd64 = "sha256-xAm7bPsnnJD7UWNTtHKMv5enHo3rM9w0M81QPqZVlP4=";
+    version = "119.0.6045.159";
   };
 }
diff --git a/pkgs/applications/networking/mailreaders/mailspring/default.nix b/pkgs/applications/networking/mailreaders/mailspring/default.nix
index 4f61935faac1..702e92c04c32 100644
--- a/pkgs/applications/networking/mailreaders/mailspring/default.nix
+++ b/pkgs/applications/networking/mailreaders/mailspring/default.nix
@@ -22,11 +22,11 @@
 
 stdenv.mkDerivation rec {
   pname = "mailspring";
-  version = "1.11.0";
+  version = "1.12.0";
 
   src = fetchurl {
     url = "https://github.com/Foundry376/Mailspring/releases/download/${version}/mailspring-${version}-amd64.deb";
-    hash = "sha256-aAqkltVxIlGwRVGM+1QkrVgfnitl+D3Xb0qi0o8ow+Q=";
+    hash = "sha256-6dTAPetJgYrvIEtu+2QxcBOeYFZfN/dFhM0CZFzcC/E=";
   };
 
   nativeBuildInputs = [
@@ -57,6 +57,7 @@ stdenv.mkDerivation rec {
     openssl
     (lib.getLib udev)
     libappindicator
+    libsecret
   ];
 
   unpackPhase = ''
diff --git a/pkgs/applications/version-management/gitlab/default.nix b/pkgs/applications/version-management/gitlab/default.nix
index bc5d3aa8b33d..c3e715ad46fe 100644
--- a/pkgs/applications/version-management/gitlab/default.nix
+++ b/pkgs/applications/version-management/gitlab/default.nix
@@ -1,5 +1,5 @@
 { stdenv, lib, fetchurl, fetchpatch, fetchFromGitLab, bundlerEnv
-, ruby_3_0, tzdata, git, nettools, nixosTests, nodejs, openssl
+, ruby_3_2, tzdata, git, nettools, nixosTests, nodejs, openssl
 , gitlabEnterprise ? false, callPackage, yarn
 , fixup_yarn_lock, replace, file, cacert, fetchYarnDeps, makeWrapper, pkg-config
 }:
@@ -17,7 +17,7 @@ let
 
   rubyEnv = bundlerEnv rec {
     name = "gitlab-env-${version}";
-    ruby = ruby_3_0;
+    ruby = ruby_3_2;
     gemdir = ./rubyEnv;
     gemset =
       let x = import (gemdir + "/gemset.nix") src;
diff --git a/pkgs/applications/window-managers/leftwm/default.nix b/pkgs/applications/window-managers/leftwm/default.nix
index 91a13df5c21e..bbf1cefacd4c 100644
--- a/pkgs/applications/window-managers/leftwm/default.nix
+++ b/pkgs/applications/window-managers/leftwm/default.nix
@@ -1,4 +1,9 @@
-{ stdenv, lib, fetchFromGitHub, rustPlatform, libX11, libXinerama }:
+{ lib
+, fetchFromGitHub
+, rustPlatform
+, libX11
+, libXinerama
+}:
 
 let
   rpathLibs = [ libXinerama libX11 ];
@@ -6,16 +11,16 @@ in
 
 rustPlatform.buildRustPackage rec {
   pname = "leftwm";
-  version = "0.4.2";
+  version = "0.5.1";
 
   src = fetchFromGitHub {
     owner = "leftwm";
     repo = "leftwm";
-    rev = version;
-    sha256 = "sha256-SjEp0gQHwq3Omhx/EPnyLeQJ50Ov0rHDxmYVWBwIDBs=";
+    rev = "refs/tags/${version}";
+    hash = "sha256-wn5DurPWFwSUtc5naEL4lBSQpKWTJkugpN9mKx+Ed2Y=";
   };
 
-  cargoSha256 = "sha256-kdGqnfzO+Ev9QeZcZqISPTehEXZzCWT5S8p6JbTBreE=";
+  cargoHash = "sha256-TylRxdpAVuGtZ3Lm8je6FZ0JUwetBi6mOGRoT2M3Jyk=";
 
   buildInputs = rpathLibs;
 
@@ -23,16 +28,18 @@ rustPlatform.buildRustPackage rec {
     for p in $out/bin/left*; do
       patchelf --set-rpath "${lib.makeLibraryPath rpathLibs}" $p
     done
+
+    install -D -m 0555 leftwm/doc/leftwm.1 $out/share/man/man1/leftwm.1
   '';
 
   dontPatchELF = true;
 
-  meta = with lib; {
+  meta = {
     description = "A tiling window manager for the adventurer";
     homepage = "https://github.com/leftwm/leftwm";
-    license = licenses.mit;
-    platforms = platforms.linux;
-    maintainers = with maintainers; [ yanganto ];
-    changelog = "https://github.com/leftwm/leftwm/blob/${version}/CHANGELOG";
+    license = lib.licenses.mit;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ yanganto ];
+    changelog = "https://github.com/leftwm/leftwm/blob/${version}/CHANGELOG.md";
   };
 }
diff --git a/pkgs/by-name/cy/cyme/package.nix b/pkgs/by-name/cy/cyme/package.nix
index 3e32c22d2e41..bcb06b8ed208 100644
--- a/pkgs/by-name/cy/cyme/package.nix
+++ b/pkgs/by-name/cy/cyme/package.nix
@@ -12,16 +12,16 @@
 
 rustPlatform.buildRustPackage rec {
   pname = "cyme";
-  version = "1.5.0";
+  version = "1.5.2";
 
   src = fetchFromGitHub {
     owner = "tuna-f1sh";
     repo = "cyme";
     rev = "v${version}";
-    hash = "sha256-UXh97pHJ9wa/xSslHLB7WVDwLKJYvLPgmPX8RvKrsTI=";
+    hash = "sha256-Y5TcRcbqarcKRDWCI36YhbLJFU+yrpAE3vRGArbfr0U=";
   };
 
-  cargoHash = "sha256-hSd53K50Y4K/fYGfsT2fHUaipVSpeYN6/EOFlv4ocuE=";
+  cargoHash = "sha256-ycFNNTZ7AU4WRnf1+RJB7KxQKVdJbubB28tS/GyU0bI=";
 
   nativeBuildInputs = [
     pkg-config
diff --git a/pkgs/by-name/no/nom/package.nix b/pkgs/by-name/no/nom/package.nix
index 258e1b44c378..fde0f3378c39 100644
--- a/pkgs/by-name/no/nom/package.nix
+++ b/pkgs/by-name/no/nom/package.nix
@@ -4,13 +4,13 @@
 }:
 buildGoModule rec {
   pname = "nom";
-  version = "2.0.2";
+  version = "2.0.5";
 
   src = fetchFromGitHub {
     owner = "guyfedwards";
     repo = "nom";
     rev = "v${version}";
-    hash = "sha256-6tk8NRuBbRMoaz3CmUUOC6thxIgjk/MWl50+YgQ6l5o=";
+    hash = "sha256-mYE8cu7qHRyG/pZSr4u6tMEF3ZM5Qz+CX+oLf/chwl4=";
   };
 
   vendorHash = "sha256-fP6yxfIQoVaBC9hYcrCyo3YP3ntEVDbDTwKMO9TdyDI=";
diff --git a/pkgs/by-name/py/pyprland/package.nix b/pkgs/by-name/py/pyprland/package.nix
index 751dbbd61e05..51bf39609590 100644
--- a/pkgs/by-name/py/pyprland/package.nix
+++ b/pkgs/by-name/py/pyprland/package.nix
@@ -2,7 +2,7 @@
 
 python3Packages.buildPythonApplication rec {
   pname = "pyprland";
-  version = "1.5.3";
+  version = "1.6.0";
   format = "pyproject";
 
   disabled = python3Packages.pythonOlder "3.10";
@@ -11,7 +11,7 @@ python3Packages.buildPythonApplication rec {
     owner = "hyprland-community";
     repo = "pyprland";
     rev = version;
-    hash = "sha256-PmE52pbEhc4+SkuyEeVUZoMVcbgK6CYA8HNwYPpgaIw=";
+    hash = "sha256-QbbBpaBIlU4IoU/NM7igDap8TxOKePQ8JI3ZlH944Bs=";
   };
 
   nativeBuildInputs = with python3Packages; [ poetry-core ];
diff --git a/pkgs/by-name/wo/wordlists/package.nix b/pkgs/by-name/wo/wordlists/package.nix
index 16106707fd96..5edd1f5ece4e 100644
--- a/pkgs/by-name/wo/wordlists/package.nix
+++ b/pkgs/by-name/wo/wordlists/package.nix
@@ -1,11 +1,8 @@
 { lib
-, callPackage
+, symlinkJoin
 , nmap
 , rockyou
-, runtimeShell
 , seclists
-, symlinkJoin
-, tree
 , wfuzz
 , lists ? [
     nmap
@@ -13,33 +10,39 @@
     seclists
     wfuzz
   ]
+, writeShellScriptBin
+, tree
 }:
+let
+  wordlistsCollection = symlinkJoin {
+    name = "wordlists-collection";
+    paths = lists;
 
-symlinkJoin rec {
-  pname = "wordlists";
-  version = "unstable-2023-10-10";
-
-  name = "${pname}-${version}";
-  paths = lists;
+    postBuild = ''
+      shopt -s extglob
+      rm -rf $out/!(share)
+      rm -rf $out/share/!(wordlists)
+      shopt -u extglob
+    '';
+  };
 
-  postBuild = ''
-    mkdir -p $out/bin
+  # A command to show the location of the links.
+  wordlistsBin = writeShellScriptBin "wordlists" ''
+    ${lib.getExe tree} ${wordlistsCollection}/share/wordlists
+  '';
+  # A command for easy access to the wordlists.
+  wordlistsPathBin = writeShellScriptBin "wordlists_path" ''
+    printf "${wordlistsCollection}/share/wordlists\n"
+  '';
 
-    # Create a command to show the location of the links.
-    cat >> $out/bin/wordlists << __EOF__
-    #!${runtimeShell}
-    ${tree}/bin/tree ${placeholder "out"}/share/wordlists
-    __EOF__
-    chmod +x $out/bin/wordlists
+in symlinkJoin {
+  name = "wordlists";
 
-    # Create a handy command for easy access to the wordlists.
-    # e.g.: `cat "$(wordlists_path)/rockyou.txt"`, or `ls "$(wordlists_path)/dirbuster"`
-    cat >> $out/bin/wordlists_path << __EOF__
-    #!${runtimeShell}
-    printf "${placeholder "out"}/share/wordlists\n"
-    __EOF__
-    chmod +x $out/bin/wordlists_path
-  '';
+  paths = [
+    wordlistsCollection
+    wordlistsBin
+    wordlistsPathBin
+  ];
 
   meta = with lib; {
     description = "A collection of wordlists useful for security testing";
@@ -65,6 +68,6 @@ symlinkJoin rec {
       If you want to add a new package that provides wordlist/s the convention
       is to copy it to {file}`$out/share/wordlists/myNewWordlist`.
     '';
-    maintainers = with maintainers; [ janik pamplemousse ];
+    maintainers = with maintainers; [ janik pamplemousse h7x4 ];
   };
 }
diff --git a/pkgs/development/compilers/llvm/5/clang/LLVMgold-path.patch b/pkgs/development/compilers/llvm/5/clang/LLVMgold-path.patch
deleted file mode 100644
index 6a09c91b5132..000000000000
--- a/pkgs/development/compilers/llvm/5/clang/LLVMgold-path.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff --git a/lib/Driver/ToolChains/CommonArgs.cpp b/lib/Driver/ToolChains/CommonArgs.cpp
-index 00bd60bc24bb..17416b0bd3c0 100644
---- a/lib/Driver/ToolChains/CommonArgs.cpp
-+++ b/lib/Driver/ToolChains/CommonArgs.cpp
-@@ -376,8 +376,7 @@ void tools::AddGoldPlugin(const ToolChain &ToolChain, const ArgList &Args,
-   // as gold requires -plugin to come before any -plugin-opt that -Wl might
-   // forward.
-   CmdArgs.push_back("-plugin");
--  std::string Plugin =
--      ToolChain.getDriver().Dir + "/../lib" CLANG_LIBDIR_SUFFIX "/LLVMgold.so";
-+  std::string Plugin = "@libllvmLibdir@" "/LLVMgold.so";
-   CmdArgs.push_back(Args.MakeArgString(Plugin));
- 
-   // Try to pass driver level flags relevant to LTO code generation down to
diff --git a/pkgs/development/compilers/llvm/5/clang/default.nix b/pkgs/development/compilers/llvm/5/clang/default.nix
deleted file mode 100644
index 70ffb3e0dd19..000000000000
--- a/pkgs/development/compilers/llvm/5/clang/default.nix
+++ /dev/null
@@ -1,127 +0,0 @@
-{ lib, stdenv, llvm_meta, fetch, substituteAll, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3
-, buildLlvmTools
-, fixDarwinDylibNames
-, enableManpages ? false
-}:
-
-let
-  self = stdenv.mkDerivation ({
-    pname = "clang";
-    inherit version;
-
-    src = fetch "cfe" "0018520c4qxf5hgjdqgpz2dgl3faf4gsz87fdlb8zdmx99rfk77s";
-
-    unpackPhase = ''
-      unpackFile $src
-      mv cfe-${version}* clang
-      sourceRoot=$PWD/clang
-      unpackFile ${clang-tools-extra_src}
-      mv clang-tools-extra-* $sourceRoot/tools/extra
-    '';
-
-    nativeBuildInputs = [ cmake python3 ]
-      ++ lib.optional enableManpages python3.pkgs.sphinx
-      ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
-
-    buildInputs = [ libxml2 libllvm ];
-
-    cmakeFlags = [
-      "-DCMAKE_CXX_FLAGS=-std=c++11"
-      "-DLLVM_ENABLE_RTTI=ON"
-      "-DLLVM_CONFIG_PATH=${libllvm.dev}/bin/llvm-config${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-native"}"
-    ] ++ lib.optionals enableManpages [
-      "-DCLANG_INCLUDE_DOCS=ON"
-      "-DLLVM_ENABLE_SPHINX=ON"
-      "-DSPHINX_OUTPUT_MAN=ON"
-      "-DSPHINX_OUTPUT_HTML=OFF"
-      "-DSPHINX_WARNINGS_AS_ERRORS=OFF"
-    ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
-      "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen"
-      "-DCLANG_TABLEGEN=${buildLlvmTools.libclang.dev}/bin/clang-tblgen"
-    ];
-
-    patches = [
-      ../../common/clang/5-8-purity.patch
-      ./gnu-install-dirs.patch
-      (substituteAll {
-        src = ./LLVMgold-path.patch;
-        libllvmLibdir = "${libllvm.lib}/lib";
-      })
-    ];
-
-    postPatch = ''
-      sed -i -e 's/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' \
-             -e 's/Args.hasArg(options::OPT_nostdlibinc)/true/' \
-             lib/Driver/ToolChains/*.cpp
-    '' + lib.optionalString stdenv.hostPlatform.isMusl ''
-      sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp
-    '';
-
-    outputs = [ "out" "lib" "dev" "python" ];
-
-    postInstall = ''
-      ln -sv $out/bin/clang $out/bin/cpp
-
-      # Move libclang to 'lib' output
-      moveToOutput "lib/libclang.*" "$lib"
-      substituteInPlace $out/lib/cmake/clang/ClangTargets-release.cmake \
-          --replace "\''${_IMPORT_PREFIX}/lib/libclang." "$lib/lib/libclang."
-
-      mkdir -p $python/bin $python/share/{clang,scan-view}
-      mv $out/bin/{git-clang-format,scan-view} $python/bin
-      if [ -e $out/bin/set-xcode-analyzer ]; then
-        mv $out/bin/set-xcode-analyzer $python/bin
-      fi
-      mv $out/share/clang/*.py $python/share/clang
-      mv $out/share/scan-view/*.py $python/share/scan-view
-      rm $out/bin/c-index-test
-      patchShebangs $python/bin
-
-      mkdir -p $dev/bin
-      cp bin/clang-tblgen $dev/bin
-    '';
-
-    passthru = {
-      inherit libllvm;
-      isClang = true;
-      hardeningUnsupportedFlags = [ "fortify3" ];
-    };
-
-    meta = llvm_meta // {
-      homepage = "https://clang.llvm.org/";
-      description = "A C language family frontend for LLVM";
-      longDescription = ''
-        The Clang project provides a language front-end and tooling
-        infrastructure for languages in the C language family (C, C++, Objective
-        C/C++, OpenCL, CUDA, and RenderScript) for the LLVM project.
-        It aims to deliver amazingly fast compiles, extremely useful error and
-        warning messages and to provide a platform for building great source
-        level tools. The Clang Static Analyzer and clang-tidy are tools that
-        automatically find bugs in your code, and are great examples of the sort
-        of tools that can be built using the Clang frontend as a library to
-        parse C/C++ code.
-      '';
-      mainProgram = "clang";
-    };
-  } // lib.optionalAttrs enableManpages {
-    pname = "clang-manpages";
-
-    buildPhase = ''
-      make docs-clang-man
-    '';
-
-    installPhase = ''
-      mkdir -p $out/share/man/man1
-      # Manually install clang manpage
-      cp docs/man/*.1 $out/share/man/man1/
-    '';
-
-    outputs = [ "out" ];
-
-    doCheck = false;
-
-    meta = llvm_meta // {
-      description = "man page for Clang ${version}";
-    };
-  });
-in self
diff --git a/pkgs/development/compilers/llvm/5/clang/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/5/clang/gnu-install-dirs.patch
deleted file mode 100644
index 7e6903222f45..000000000000
--- a/pkgs/development/compilers/llvm/5/clang/gnu-install-dirs.patch
+++ /dev/null
@@ -1,242 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 2667b1d6892e..87c5ad58738f 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -5,6 +5,8 @@ cmake_minimum_required(VERSION 3.4.3)
- if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
-   project(Clang)
- 
-+  include(GNUInstallDirs)
-+
-   # Rely on llvm-config.
-   set(CONFIG_OUTPUT)
-   find_program(LLVM_CONFIG "llvm-config")
-@@ -344,7 +346,7 @@ include_directories(BEFORE
- 
- if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
-   install(DIRECTORY include/clang include/clang-c
--    DESTINATION include
-+    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
-     FILES_MATCHING
-     PATTERN "*.def"
-     PATTERN "*.h"
-@@ -353,7 +355,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
-     )
- 
-   install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/clang
--    DESTINATION include
-+    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
-     FILES_MATCHING
-     PATTERN "CMakeFiles" EXCLUDE
-     PATTERN "*.inc"
-@@ -361,7 +363,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
-     )
- 
-   install(PROGRAMS utils/bash-autocomplete.sh
--    DESTINATION share/clang
-+    DESTINATION ${CMAKE_INSTALL_DATADIR}/clang
-     )
- endif()
- 
-diff --git a/cmake/modules/AddClang.cmake b/cmake/modules/AddClang.cmake
-index e657059744a4..19da44638fe6 100644
---- a/cmake/modules/AddClang.cmake
-+++ b/cmake/modules/AddClang.cmake
-@@ -99,9 +99,9 @@ macro(add_clang_library name)
-       install(TARGETS ${name}
-         COMPONENT ${name}
-         ${export_to_clangtargets}
--        LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
--        ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
--        RUNTIME DESTINATION bin)
-+        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}
-+        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}
-+        RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
- 
-       if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES)
-         add_custom_target(install-${name}
-@@ -143,7 +143,7 @@ macro(add_clang_tool name)
- 
-     install(TARGETS ${name}
-       ${export_to_clangtargets}
--      RUNTIME DESTINATION bin
-+      RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
-       COMPONENT ${name})
- 
-     if(NOT CMAKE_CONFIGURATION_TYPES)
-@@ -160,5 +160,5 @@ endmacro()
- macro(add_clang_symlink name dest)
-   add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE)
-   # Always generate install targets
--  llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE)
-+  llvm_install_symlink(${name} ${dest} ${CMAKE_INSTALL_FULL_BINDIR} ALWAYS_GENERATE)
- endmacro()
-diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt
-index a621c02644e3..e140efc9c83c 100644
---- a/lib/Headers/CMakeLists.txt
-+++ b/lib/Headers/CMakeLists.txt
-@@ -129,13 +129,13 @@ install(
-   FILES ${files} ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h
-   COMPONENT clang-headers
-   PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
--  DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
-+  DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
- 
- install(
-   FILES ${cuda_wrapper_files}
-   COMPONENT clang-headers
-   PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
--  DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include/cuda_wrappers)
-+  DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include/cuda_wrappers)
- 
- if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDE's.
-   add_custom_target(install-clang-headers
-diff --git a/tools/c-index-test/CMakeLists.txt b/tools/c-index-test/CMakeLists.txt
-index ad990e010eef..92e52d05afb9 100644
---- a/tools/c-index-test/CMakeLists.txt
-+++ b/tools/c-index-test/CMakeLists.txt
-@@ -48,7 +48,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
-     set_property(TARGET c-index-test APPEND PROPERTY INSTALL_RPATH
-        "@executable_path/../../lib")
-   else()
--    set(INSTALL_DESTINATION bin)
-+    set(INSTALL_DESTINATION ${CMAKE_INSTALL_BINDIR})
-   endif()
- 
-   install(TARGETS c-index-test
-diff --git a/tools/clang-check/CMakeLists.txt b/tools/clang-check/CMakeLists.txt
-index 04151a8e0331..13918d91c4ba 100644
---- a/tools/clang-check/CMakeLists.txt
-+++ b/tools/clang-check/CMakeLists.txt
-@@ -19,4 +19,4 @@ target_link_libraries(clang-check
-   )
- 
- install(TARGETS clang-check
--  RUNTIME DESTINATION bin)
-+  RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
-diff --git a/tools/clang-format/CMakeLists.txt b/tools/clang-format/CMakeLists.txt
-index a13633eaefc4..9b0094783690 100644
---- a/tools/clang-format/CMakeLists.txt
-+++ b/tools/clang-format/CMakeLists.txt
-@@ -20,20 +20,20 @@ if( LLVM_USE_SANITIZE_COVERAGE )
- endif()
- 
- install(PROGRAMS clang-format-bbedit.applescript
--  DESTINATION share/clang
-+  DESTINATION ${CMAKE_INSTALL_DATADIR}/clang
-   COMPONENT clang-format)
- install(PROGRAMS clang-format-diff.py
--  DESTINATION share/clang
-+  DESTINATION ${CMAKE_INSTALL_DATADIR}/clang
-   COMPONENT clang-format)
- install(PROGRAMS clang-format-sublime.py
--  DESTINATION share/clang
-+  DESTINATION ${CMAKE_INSTALL_DATADIR}/clang
-   COMPONENT clang-format)
- install(PROGRAMS clang-format.el
--  DESTINATION share/clang
-+  DESTINATION ${CMAKE_INSTALL_DATADIR}/clang
-   COMPONENT clang-format)
- install(PROGRAMS clang-format.py
--  DESTINATION share/clang
-+  DESTINATION ${CMAKE_INSTALL_DATADIR}/clang
-   COMPONENT clang-format)
- install(PROGRAMS git-clang-format
--  DESTINATION bin
-+  DESTINATION ${CMAKE_INSTALL_BINDIR}
-   COMPONENT clang-format)
-diff --git a/tools/clang-offload-bundler/CMakeLists.txt b/tools/clang-offload-bundler/CMakeLists.txt
-index 6161d08ae587..a003292d1676 100644
---- a/tools/clang-offload-bundler/CMakeLists.txt
-+++ b/tools/clang-offload-bundler/CMakeLists.txt
-@@ -21,4 +21,4 @@ target_link_libraries(clang-offload-bundler
-   ${CLANG_OFFLOAD_BUNDLER_LIB_DEPS}
-   )
- 
--install(TARGETS clang-offload-bundler RUNTIME DESTINATION bin)
-+install(TARGETS clang-offload-bundler RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
-diff --git a/tools/clang-rename/CMakeLists.txt b/tools/clang-rename/CMakeLists.txt
-index 771e3bdea6f0..d1396e62b28f 100644
---- a/tools/clang-rename/CMakeLists.txt
-+++ b/tools/clang-rename/CMakeLists.txt
-@@ -14,11 +14,11 @@ target_link_libraries(clang-rename
-   clangToolingRefactor
-   )
- 
--install(TARGETS clang-rename RUNTIME DESTINATION bin)
-+install(TARGETS clang-rename RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
- 
- install(PROGRAMS clang-rename.py
--  DESTINATION share/clang
-+  DESTINATION ${CMAKE_INSTALL_DATADIR}/clang
-   COMPONENT clang-rename)
- install(PROGRAMS clang-rename.el
--  DESTINATION share/clang
-+  DESTINATION ${CMAKE_INSTALL_DATADIR}/clang
-   COMPONENT clang-rename)
-diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt
-index 2dd670307636..1fe576f77ddb 100644
---- a/tools/libclang/CMakeLists.txt
-+++ b/tools/libclang/CMakeLists.txt
-@@ -121,7 +121,7 @@ endif()
- if(INTERNAL_INSTALL_PREFIX)
-   set(LIBCLANG_HEADERS_INSTALL_DESTINATION "${INTERNAL_INSTALL_PREFIX}/include")
- else()
--  set(LIBCLANG_HEADERS_INSTALL_DESTINATION include)
-+  set(LIBCLANG_HEADERS_INSTALL_DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
- endif()
- 
- install(DIRECTORY ../../include/clang-c
-diff --git a/tools/scan-build/CMakeLists.txt b/tools/scan-build/CMakeLists.txt
-index 380379300b09..adfd58ed5f7d 100644
---- a/tools/scan-build/CMakeLists.txt
-+++ b/tools/scan-build/CMakeLists.txt
-@@ -41,7 +41,7 @@ if(CLANG_INSTALL_SCANBUILD)
-                          ${CMAKE_BINARY_DIR}/bin/
-                        DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile})
-     list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile})
--    install(PROGRAMS bin/${BinFile} DESTINATION bin)
-+    install(PROGRAMS bin/${BinFile} DESTINATION ${CMAKE_INSTALL_BINDIR})
-   endforeach()
- 
-   foreach(LibexecFile ${LibexecFiles})
-@@ -53,7 +53,7 @@ if(CLANG_INSTALL_SCANBUILD)
-                          ${CMAKE_BINARY_DIR}/libexec/
-                        DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/libexec/${LibexecFile})
-     list(APPEND Depends ${CMAKE_BINARY_DIR}/libexec/${LibexecFile})
--    install(PROGRAMS libexec/${LibexecFile} DESTINATION libexec)
-+    install(PROGRAMS libexec/${LibexecFile} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR})
-   endforeach()
- 
-   foreach(ManPage ${ManPages})
-@@ -77,7 +77,7 @@ if(CLANG_INSTALL_SCANBUILD)
-                          ${CMAKE_BINARY_DIR}/share/scan-build/
-                        DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/share/scan-build/${ShareFile})
-     list(APPEND Depends ${CMAKE_BINARY_DIR}/share/scan-build/${ShareFile})
--    install(FILES share/scan-build/${ShareFile} DESTINATION share/scan-build)
-+    install(FILES share/scan-build/${ShareFile} DESTINATION ${CMAKE_INSTALL_DATADIR}/scan-build)
-   endforeach()
- 
-   add_custom_target(scan-build ALL DEPENDS ${Depends})
-diff --git a/tools/scan-view/CMakeLists.txt b/tools/scan-view/CMakeLists.txt
-index b305ca562a72..554bcb379061 100644
---- a/tools/scan-view/CMakeLists.txt
-+++ b/tools/scan-view/CMakeLists.txt
-@@ -21,7 +21,7 @@ if(CLANG_INSTALL_SCANVIEW)
-                          ${CMAKE_BINARY_DIR}/bin/
-                        DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile})
-     list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile})
--    install(PROGRAMS bin/${BinFile} DESTINATION bin)
-+    install(PROGRAMS bin/${BinFile} DESTINATION ${CMAKE_INSTALL_BINDIR})
-   endforeach()
- 
-   foreach(ShareFile ${ShareFiles})
-@@ -33,7 +33,7 @@ if(CLANG_INSTALL_SCANVIEW)
-                          ${CMAKE_BINARY_DIR}/share/scan-view/
-                        DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/share/${ShareFile})
-     list(APPEND Depends ${CMAKE_BINARY_DIR}/share/scan-view/${ShareFile})
--    install(FILES share/${ShareFile} DESTINATION share/scan-view)
-+    install(FILES share/${ShareFile} DESTINATION ${CMAKE_INSTALL_DATADIR}/scan-view)
-   endforeach()
- 
-   add_custom_target(scan-view ALL DEPENDS ${Depends})
diff --git a/pkgs/development/compilers/llvm/5/compiler-rt/armv7l.patch b/pkgs/development/compilers/llvm/5/compiler-rt/armv7l.patch
deleted file mode 100644
index 77bf2640c477..000000000000
--- a/pkgs/development/compilers/llvm/5/compiler-rt/armv7l.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-diff -ur compiler-rt-5.0.2.src/cmake/builtin-config-ix.cmake compiler-rt-5.0.2.src-patched/cmake/builtin-config-ix.cmake
---- compiler-rt-5.0.2.src/cmake/builtin-config-ix.cmake	2017-05-25 00:53:24.000000000 +0900
-+++ compiler-rt-5.0.2.src-patched/cmake/builtin-config-ix.cmake	2020-05-10 03:24:24.937433155 +0900
-@@ -24,7 +24,7 @@
- 
- 
- set(ARM64 aarch64)
--set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k)
-+set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k armv7l)
- set(X86 i386 i686)
- set(X86_64 x86_64)
- set(MIPS32 mips mipsel)
-diff -ur compiler-rt-5.0.2.src/lib/builtins/CMakeLists.txt compiler-rt-5.0.2.src-patched/lib/builtins/CMakeLists.txt
---- compiler-rt-5.0.2.src/lib/builtins/CMakeLists.txt	2017-07-13 04:33:30.000000000 +0900
-+++ compiler-rt-5.0.2.src-patched/lib/builtins/CMakeLists.txt	2020-05-10 03:24:45.945075423 +0900
-@@ -444,6 +444,7 @@
- set(armv7_SOURCES ${arm_SOURCES})
- set(armv7s_SOURCES ${arm_SOURCES})
- set(armv7k_SOURCES ${arm_SOURCES})
-+set(armv7l_SOURCES ${arm_SOURCES})
- set(arm64_SOURCES ${aarch64_SOURCES})
- 
- # macho_embedded archs
diff --git a/pkgs/development/compilers/llvm/5/compiler-rt/codesign.patch b/pkgs/development/compilers/llvm/5/compiler-rt/codesign.patch
deleted file mode 100644
index 8f4c76bca1eb..000000000000
--- a/pkgs/development/compilers/llvm/5/compiler-rt/codesign.patch
+++ /dev/null
@@ -1,155 +0,0 @@
-From 3dec5f3475a26aeb4678627795c4b67c6b7b4785 Mon Sep 17 00:00:00 2001
-From: Will Dietz <w@wdtz.org>
-Date: Tue, 19 Sep 2017 13:13:06 -0500
-Subject: [PATCH] remove codesign use on Apple, disable ios sim testing that
- needs it
-
----
- cmake/Modules/AddCompilerRT.cmake |  8 ------
- test/asan/CMakeLists.txt          | 52 ---------------------------------------
- test/tsan/CMakeLists.txt          | 47 -----------------------------------
- 3 files changed, 107 deletions(-)
-
-diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake
-index bc5fb9ff7..b64eb4246 100644
---- a/cmake/Modules/AddCompilerRT.cmake
-+++ b/cmake/Modules/AddCompilerRT.cmake
-@@ -210,14 +210,6 @@ function(add_compiler_rt_runtime name type)
-         set_target_properties(${libname} PROPERTIES IMPORT_PREFIX "")
-         set_target_properties(${libname} PROPERTIES IMPORT_SUFFIX ".lib")
-       endif()
--      if(APPLE)
--        # Ad-hoc sign the dylibs
--        add_custom_command(TARGET ${libname}
--          POST_BUILD  
--          COMMAND codesign --sign - $<TARGET_FILE:${libname}>
--          WORKING_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR}
--        )
--      endif()
-     endif()
-     install(TARGETS ${libname}
-       ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}
-diff --git a/test/asan/CMakeLists.txt b/test/asan/CMakeLists.txt
-index 8bfc15b5c..f23d0f71a 100644
---- a/test/asan/CMakeLists.txt
-+++ b/test/asan/CMakeLists.txt
-@@ -83,58 +83,6 @@ foreach(arch ${ASAN_TEST_ARCH})
-   endif()
- endforeach()
- 
--# iOS and iOS simulator test suites
--# These are not added into "check-all", in order to run these tests, use
--# "check-asan-iossim-x86_64" and similar. They also require that an extra env
--# variable to select which iOS device or simulator to use, e.g.:
--# SANITIZER_IOSSIM_TEST_DEVICE_IDENTIFIER="iPhone 6"
--if(APPLE)
--  set(EXCLUDE_FROM_ALL ON)
--
--  set(ASAN_TEST_TARGET_CC ${COMPILER_RT_TEST_COMPILER})
--  set(ASAN_TEST_IOS "1")
--  pythonize_bool(ASAN_TEST_IOS)
--  set(ASAN_TEST_DYNAMIC True)
--
--  foreach(arch ${DARWIN_iossim_ARCHS})
--    set(ASAN_TEST_IOSSIM "1")
--    pythonize_bool(ASAN_TEST_IOSSIM)
--    set(ASAN_TEST_TARGET_ARCH ${arch})
--    set(ASAN_TEST_TARGET_CFLAGS "-arch ${arch} -isysroot ${DARWIN_iossim_SYSROOT} ${COMPILER_RT_TEST_COMPILER_CFLAGS}")
--    set(ASAN_TEST_CONFIG_SUFFIX "-${arch}-iossim")
--    get_bits_for_arch(${arch} ASAN_TEST_BITS)
--    string(TOUPPER ${arch} ARCH_UPPER_CASE)
--    set(CONFIG_NAME "IOSSim${ARCH_UPPER_CASE}Config")
--    configure_lit_site_cfg(
--      ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
--      ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg
--      )
--    add_lit_testsuite(check-asan-iossim-${arch} "AddressSanitizer iOS Simulator ${arch} tests"
--      ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/
--      DEPENDS ${ASAN_TEST_DEPS})
--  endforeach()
--
--  foreach (arch ${DARWIN_ios_ARCHS})
--    set(ASAN_TEST_IOSSIM "0")
--    pythonize_bool(ASAN_TEST_IOSSIM)
--    set(ASAN_TEST_TARGET_ARCH ${arch})
--    set(ASAN_TEST_TARGET_CFLAGS "-arch ${arch} -isysroot ${DARWIN_ios_SYSROOT} ${COMPILER_RT_TEST_COMPILER_CFLAGS}")
--    set(ASAN_TEST_CONFIG_SUFFIX "-${arch}-ios")
--    get_bits_for_arch(${arch} ASAN_TEST_BITS)
--    string(TOUPPER ${arch} ARCH_UPPER_CASE)
--    set(CONFIG_NAME "IOS${ARCH_UPPER_CASE}Config")
--    configure_lit_site_cfg(
--      ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
--      ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg
--      )
--    add_lit_testsuite(check-asan-ios-${arch} "AddressSanitizer iOS ${arch} tests"
--      ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/
--      DEPENDS ${ASAN_TEST_DEPS})
--  endforeach()
--
--  set(EXCLUDE_FROM_ALL OFF)
--endif()
--
- # Add unit tests.
- if(COMPILER_RT_INCLUDE_TESTS)
-   set(ASAN_TEST_DYNAMIC False)
-diff --git a/test/tsan/CMakeLists.txt b/test/tsan/CMakeLists.txt
-index a68908612..cde0accb5 100644
---- a/test/tsan/CMakeLists.txt
-+++ b/test/tsan/CMakeLists.txt
-@@ -42,53 +42,6 @@ foreach(arch ${TSAN_TEST_ARCH})
-   list(APPEND TSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME})
- endforeach()
- 
--# iOS and iOS simulator test suites
--# These are not added into "check-all", in order to run these tests, use
--# "check-tsan-iossim-x86_64" and similar. They also require an extra environment
--# variable to select which iOS device or simulator to use, e.g.:
--# SANITIZER_IOSSIM_TEST_DEVICE_IDENTIFIER="iPhone 6"
--if(APPLE)
--  set(EXCLUDE_FROM_ALL ON)
--
--  set(TSAN_TEST_TARGET_CC ${COMPILER_RT_TEST_COMPILER})
--  set(TSAN_TEST_IOS "1")
--  pythonize_bool(TSAN_TEST_IOS)
--
--  set(arch "x86_64")
--  set(TSAN_TEST_IOSSIM "1")
--  pythonize_bool(TSAN_TEST_IOSSIM)
--  set(TSAN_TEST_TARGET_ARCH ${arch})
--  set(TSAN_TEST_TARGET_CFLAGS "-arch ${arch} -isysroot ${DARWIN_iossim_SYSROOT} ${COMPILER_RT_TEST_COMPILER_CFLAGS}")
--  set(TSAN_TEST_CONFIG_SUFFIX "-${arch}-iossim")
--  string(TOUPPER ${arch} ARCH_UPPER_CASE)
--  set(CONFIG_NAME "IOSSim${ARCH_UPPER_CASE}Config")
--  configure_lit_site_cfg(
--    ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
--    ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg
--    )
--  add_lit_testsuite(check-tsan-iossim-${arch} "ThreadSanitizer iOS Simulator ${arch} tests"
--    ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/
--    DEPENDS ${TSAN_TEST_DEPS})
--
--  set(arch "arm64")
--  set(TSAN_TEST_IOSSIM "0")
--  pythonize_bool(TSAN_TEST_IOSSIM)
--  set(TSAN_TEST_TARGET_ARCH ${arch})
--  set(TSAN_TEST_TARGET_CFLAGS "-arch ${arch} -isysroot ${DARWIN_ios_SYSROOT} ${COMPILER_RT_TEST_COMPILER_CFLAGS}")
--  set(TSAN_TEST_CONFIG_SUFFIX "-${arch}-ios")
--  string(TOUPPER ${arch} ARCH_UPPER_CASE)
--  set(CONFIG_NAME "IOS${ARCH_UPPER_CASE}Config")
--  configure_lit_site_cfg(
--    ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
--    ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg
--    )
--  add_lit_testsuite(check-tsan-ios-${arch} "ThreadSanitizer iOS Simulator ${arch} tests"
--    ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/
--    DEPENDS ${TSAN_TEST_DEPS})
--
--  set(EXCLUDE_FROM_ALL OFF)
--endif()
--
- if(COMPILER_RT_INCLUDE_TESTS)
-   configure_lit_site_cfg(
-     ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in
--- 
-2.14.1
-
diff --git a/pkgs/development/compilers/llvm/5/compiler-rt/compiler-rt-5-cstddef.patch b/pkgs/development/compilers/llvm/5/compiler-rt/compiler-rt-5-cstddef.patch
deleted file mode 100644
index e7abf9735b90..000000000000
--- a/pkgs/development/compilers/llvm/5/compiler-rt/compiler-rt-5-cstddef.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/lib/xray/xray_buffer_queue.h
-+++ b/lib/xray/xray_buffer_queue.h
-@@ -17,6 +17,7 @@
- 
- #include "sanitizer_common/sanitizer_atomic.h"
- #include "sanitizer_common/sanitizer_mutex.h"
-+#include <cstddef>
- #include <deque>
- #include <unordered_set>
- #include <utility>
diff --git a/pkgs/development/compilers/llvm/5/compiler-rt/default.nix b/pkgs/development/compilers/llvm/5/compiler-rt/default.nix
deleted file mode 100644
index fede3347e42b..000000000000
--- a/pkgs/development/compilers/llvm/5/compiler-rt/default.nix
+++ /dev/null
@@ -1,112 +0,0 @@
-{ lib, stdenv, llvm_meta, version, fetch, cmake, python3, libllvm, libcxxabi
-, doFakeLibgcc ? stdenv.hostPlatform.isFreeBSD
-}:
-
-let
-
-  useLLVM = stdenv.hostPlatform.useLLVM or false;
-  bareMetal = stdenv.hostPlatform.parsed.kernel.name == "none";
-  inherit (stdenv.hostPlatform) isMusl;
-
-in
-
-stdenv.mkDerivation {
-  pname = "compiler-rt";
-  inherit version;
-  src = fetch "compiler-rt" "0ipd4jdxpczgr2w6lzrabymz6dhzj69ywmyybjjc1q397zgrvziy";
-
-  nativeBuildInputs = [ cmake python3 libllvm.dev ];
-  buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi;
-
-  env.NIX_CFLAGS_COMPILE = toString [
-    "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0"
-  ];
-
-  cmakeFlags = [
-    "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON"
-    "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}"
-    "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}"
-  ] ++ lib.optionals (useLLVM || bareMetal || isMusl) [
-    "-DCOMPILER_RT_BUILD_SANITIZERS=OFF"
-    "-DCOMPILER_RT_BUILD_XRAY=OFF"
-    "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF"
-  ] ++ lib.optionals (useLLVM || bareMetal) [
-    "-DCOMPILER_RT_BUILD_PROFILE=OFF"
-  ] ++ lib.optionals (useLLVM || bareMetal) [
-    "-DCMAKE_C_COMPILER_WORKS=ON"
-    "-DCMAKE_CXX_COMPILER_WORKS=ON"
-    "-DCOMPILER_RT_BAREMETAL_BUILD=ON"
-    "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}"
-  ] ++ lib.optionals (useLLVM) [
-    "-DCOMPILER_RT_BUILD_BUILTINS=ON"
-    "-DCMAKE_C_FLAGS=-nodefaultlibs"
-    #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program
-    "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY"
-  ] ++ lib.optionals (bareMetal) [
-    "-DCOMPILER_RT_OS_DIR=baremetal"
-  ] ++ lib.optionals (stdenv.hostPlatform.isDarwin) [
-    # The compiler-rt build infrastructure sniffs supported platforms on Darwin
-    # and finds i386;x86_64;x86_64h. We only build for x86_64, so linking fails
-    # when it tries to use libc++ and libc++api for i386.
-    "-DDARWIN_osx_ARCHS=${stdenv.hostPlatform.darwinArch}"
-  ];
-
-  outputs = [ "out" "dev" ];
-
-  patches = [
-    ./codesign.patch # Revert compiler-rt commit that makes codesign mandatory
-    # https://github.com/llvm/llvm-project/commit/947f9692440836dcb8d88b74b69dd379d85974ce
-    ../../common/compiler-rt/glibc.patch
-    ./gnu-install-dirs.patch
-
-    ./sys-ustat.patch
-    ../../common/compiler-rt/libsanitizer-no-cyclades-9.patch
-    ./compiler-rt-5-cstddef.patch
-  ] ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch;
-
-  # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks
-  # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra
-  # can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd
-  # get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by
-  # a flag and turn the flag off during the stdenv build.
-  postPatch = lib.optionalString stdenv.isDarwin ''
-    substituteInPlace cmake/config-ix.cmake \
-      --replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)'
-  '' + lib.optionalString (useLLVM) ''
-    substituteInPlace lib/builtins/int_util.c \
-      --replace "#include <stdlib.h>" ""
-    substituteInPlace lib/builtins/clear_cache.c \
-      --replace "#include <assert.h>" ""
-    substituteInPlace lib/builtins/cpu_model.c \
-      --replace "#include <assert.h>" ""
-  '';
-
-  # Hack around weird upsream RPATH bug
-  postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) ''
-    ln -s "$out/lib"/*/* "$out/lib"
-  '' + lib.optionalString (useLLVM) ''
-    ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/linux/crtbegin.o
-    ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/linux/crtend.o
-    ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/linux/crtbeginS.o
-    ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/linux/crtendS.o
-  '' + lib.optionalString doFakeLibgcc ''
-    ln -s $out/lib/freebsd/libclang_rt.builtins-*.a $out/lib/freebsd/libgcc.a
-  '';
-
-  meta = llvm_meta // {
-    homepage = "https://compiler-rt.llvm.org/";
-    description = "Compiler runtime libraries";
-    longDescription = ''
-      The compiler-rt project provides highly tuned implementations of the
-      low-level code generator support routines like "__fixunsdfdi" and other
-      calls generated when a target doesn't have a short sequence of native
-      instructions to implement a core IR operation. It also provides
-      implementations of run-time libraries for dynamic testing tools such as
-      AddressSanitizer, ThreadSanitizer, MemorySanitizer, and DataFlowSanitizer.
-    '';
-    # "All of the code in the compiler-rt project is dual licensed under the MIT
-    # license and the UIUC License (a BSD-like license)":
-    license = with lib.licenses; [ mit ncsa ];
-    broken = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64;
-  };
-}
diff --git a/pkgs/development/compilers/llvm/5/compiler-rt/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/5/compiler-rt/gnu-install-dirs.patch
deleted file mode 100644
index 618e597e96d4..000000000000
--- a/pkgs/development/compilers/llvm/5/compiler-rt/gnu-install-dirs.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index f997c53410c1..ac079d89b57b 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -12,6 +12,7 @@ cmake_minimum_required(VERSION 3.4.3)
- # Check if compiler-rt is built as a standalone project.
- if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR COMPILER_RT_STANDALONE_BUILD)
-   project(CompilerRT C CXX ASM)
-+  include(GNUInstallDirs)
-   set(COMPILER_RT_STANDALONE_BUILD TRUE)
- endif()
- 
-diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake
-index bc5fb9ff722b..91fb79d1980c 100644
---- a/cmake/Modules/AddCompilerRT.cmake
-+++ b/cmake/Modules/AddCompilerRT.cmake
-@@ -344,7 +344,7 @@ macro(add_compiler_rt_resource_file target_name file_name component)
-   add_custom_target(${target_name} DEPENDS ${dst_file})
-   # Install in Clang resource directory.
-   install(FILES ${file_name}
--    DESTINATION ${COMPILER_RT_INSTALL_PATH}
-+    DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_PREFIX}
-     COMPONENT ${component})
-   add_dependencies(${component} ${target_name})
- 
-@@ -361,7 +361,7 @@ macro(add_compiler_rt_script name)
-   add_custom_target(${name} DEPENDS ${dst})
-   install(FILES ${dst}
-     PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
--    DESTINATION ${COMPILER_RT_INSTALL_PATH}/bin)
-+    DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_BINDIR})
- endmacro(add_compiler_rt_script src name)
- 
- # Builds custom version of libc++ and installs it in <prefix>.
-diff --git a/cmake/Modules/CompilerRTDarwinUtils.cmake b/cmake/Modules/CompilerRTDarwinUtils.cmake
-index f646975475bb..75885bf305b8 100644
---- a/cmake/Modules/CompilerRTDarwinUtils.cmake
-+++ b/cmake/Modules/CompilerRTDarwinUtils.cmake
-@@ -391,7 +391,7 @@ macro(darwin_add_embedded_builtin_libraries)
-     set(DARWIN_macho_embedded_LIBRARY_OUTPUT_DIR
-       ${COMPILER_RT_OUTPUT_DIR}/lib/macho_embedded)
-     set(DARWIN_macho_embedded_LIBRARY_INSTALL_DIR
--      ${COMPILER_RT_INSTALL_PATH}/lib/macho_embedded)
-+      ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/macho_embedded)
-       
-     set(CFLAGS_armv7 "-target thumbv7-apple-darwin-eabi")
-     set(CFLAGS_i386 "-march=pentium")
-diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake
-index b38c6ca96fac..a4580414cbc8 100644
---- a/cmake/base-config-ix.cmake
-+++ b/cmake/base-config-ix.cmake
-@@ -43,11 +43,11 @@ if (LLVM_TREE_AVAILABLE)
- else()
-     # Take output dir and install path from the user.
-   set(COMPILER_RT_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH
--    "Path where built compiler-rt libraries should be stored.")
-+    "Path where built compiler-rt build artifacts should be stored.")
-   set(COMPILER_RT_EXEC_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/bin CACHE PATH
-     "Path where built compiler-rt executables should be stored.")
--  set(COMPILER_RT_INSTALL_PATH ${CMAKE_INSTALL_PREFIX} CACHE PATH
--    "Path where built compiler-rt libraries should be installed.")
-+  set(COMPILER_RT_INSTALL_PATH "" CACHE PATH
-+    "Prefix where built compiler-rt artifacts should be installed, comes before CMAKE_INSTALL_PREFIX.")
-   option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests." OFF)
-   option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered" OFF)
-   # Use a host compiler to compile/link tests.
-@@ -67,9 +67,9 @@ if(NOT DEFINED COMPILER_RT_OS_DIR)
-   string(TOLOWER ${CMAKE_SYSTEM_NAME} COMPILER_RT_OS_DIR)
- endif()
- set(COMPILER_RT_LIBRARY_OUTPUT_DIR
--  ${COMPILER_RT_OUTPUT_DIR}/lib/${COMPILER_RT_OS_DIR})
-+  ${COMPILER_RT_OUTPUT_DIR}/${CMAKE_INSTALL_FULL_LIBDIR}/${COMPILER_RT_OS_DIR})
- set(COMPILER_RT_LIBRARY_INSTALL_DIR
--  ${COMPILER_RT_INSTALL_PATH}/lib/${COMPILER_RT_OS_DIR})
-+  ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_LIBDIR}/${COMPILER_RT_OS_DIR})
- 
- if(APPLE)
-   # On Darwin if /usr/include doesn't exist, the user probably has Xcode but not
-diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
-index ec3bf40b95e6..af119f10ee2b 100644
---- a/include/CMakeLists.txt
-+++ b/include/CMakeLists.txt
-@@ -44,8 +44,8 @@ set_target_properties(compiler-rt-headers PROPERTIES FOLDER "Compiler-RT Misc")
- # Install sanitizer headers.
- install(FILES ${SANITIZER_HEADERS}
-   PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
--  DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/sanitizer)
-+  DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/sanitizer)
- # Install xray headers.
- install(FILES ${XRAY_HEADERS}
-   PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
--  DESTINATION ${COMPILER_RT_INSTALL_PATH}/include/xray)
-+  DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR}/xray)
-diff --git a/lib/dfsan/CMakeLists.txt b/lib/dfsan/CMakeLists.txt
-index 2c486bff821b..0ee715da95f8 100644
---- a/lib/dfsan/CMakeLists.txt
-+++ b/lib/dfsan/CMakeLists.txt
-@@ -44,4 +44,4 @@ add_custom_command(OUTPUT ${dfsan_abilist_filename}
-                    DEPENDS done_abilist.txt libc_ubuntu1404_abilist.txt)
- add_dependencies(dfsan dfsan_abilist)
- install(FILES ${dfsan_abilist_filename}
--        DESTINATION ${COMPILER_RT_INSTALL_PATH})
-+        DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_PREFIX})
diff --git a/pkgs/development/compilers/llvm/5/compiler-rt/sys-ustat.patch b/pkgs/development/compilers/llvm/5/compiler-rt/sys-ustat.patch
deleted file mode 100644
index d9e9a10d8600..000000000000
--- a/pkgs/development/compilers/llvm/5/compiler-rt/sys-ustat.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From 521935db9de17ad08748fd050137ac83b7734835 Mon Sep 17 00:00:00 2001
-From: Craig Topper <craig.topper@intel.com>
-Date: Thu, 24 May 2018 17:59:47 +0000
-Subject: [PATCH] sanitizer: Use pre-computed size of struct ustat for Linux
-
-<sys/ustat.h> has been removed from glibc 2.28 by:
-
-commit cf2478d53ad7071e84c724a986b56fe17f4f4ca7
-Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
-Date: Sun Mar 18 11:28:59 2018 +0800
-
-Deprecate ustat syscall interface
-This patch uses pre-computed size of struct ustat for Linux to fix
-
-https://bugs.llvm.org/show_bug.cgi?id=37418
-
-Patch by H.J. Lu.
-
-Differential Revision: https://reviews.llvm.org/D47281
-
-git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@333213 91177308-0d34-0410-b5e6-96231b3b80d8
----
- .../sanitizer_platform_limits_posix.cc            | 15 +++++++++++++--
- 1 file changed, 13 insertions(+), 2 deletions(-)
-
-diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
-index 94b8f3f627..936d818673 100644
---- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
-+++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
-@@ -159,7 +159,6 @@ typedef struct user_fpregs elf_fpregset_t;
- # include <sys/procfs.h>
- #endif
- #include <sys/user.h>
--#include <sys/ustat.h>
- #include <linux/cyclades.h>
- #include <linux/if_eql.h>
- #include <linux/if_plip.h>
-@@ -253,7 +252,19 @@ namespace __sanitizer {
- #endif // SANITIZER_LINUX || SANITIZER_FREEBSD
- 
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
--  unsigned struct_ustat_sz = sizeof(struct ustat);
-+  // Use pre-computed size of struct ustat to avoid <sys/ustat.h> which
-+  // has been removed from glibc 2.28.
-+#if defined(__aarch64__) || defined(__s390x__) || defined (__mips64) \
-+  || defined(__powerpc64__) || defined(__arch64__) || defined(__sparcv9) \
-+  || defined(__x86_64__)
-+#define SIZEOF_STRUCT_USTAT 32
-+#elif defined(__arm__) || defined(__i386__) || defined(__mips__) \
-+  || defined(__powerpc__) || defined(__s390__)
-+#define SIZEOF_STRUCT_USTAT 20
-+#else
-+#error Unknown size of struct ustat
-+#endif
-+  unsigned struct_ustat_sz = SIZEOF_STRUCT_USTAT;
-   unsigned struct_rlimit64_sz = sizeof(struct rlimit64);
-   unsigned struct_statvfs64_sz = sizeof(struct statvfs64);
- #endif // SANITIZER_LINUX && !SANITIZER_ANDROID
diff --git a/pkgs/development/compilers/llvm/5/default.nix b/pkgs/development/compilers/llvm/5/default.nix
deleted file mode 100644
index 70f0d2e11bb6..000000000000
--- a/pkgs/development/compilers/llvm/5/default.nix
+++ /dev/null
@@ -1,140 +0,0 @@
-{ lowPrio, newScope, pkgs, lib, stdenv, cmake, gccForLibs
-, libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith
-, buildLlvmTools # tools, but from the previous stage, for cross
-, targetLlvmLibraries # libraries, but from the next stage, for cross
-, targetLlvm
-}:
-
-let
-  release_version = "5.0.2";
-  version = release_version; # differentiating these is important for rc's
-  targetConfig = stdenv.targetPlatform.config;
-
-  fetch = name: sha256: fetchurl {
-    url = "https://releases.llvm.org/${release_version}/${name}-${version}.src.tar.xz";
-    inherit sha256;
-  };
-
-  clang-tools-extra_src = fetch "clang-tools-extra" "018b3fiwah8f8br5i26qmzh6sjvzchpn358sn8v079m49f2jldm3";
-
-  llvm_meta = {
-    license     = lib.licenses.ncsa;
-    maintainers = lib.teams.llvm.members;
-
-    # See llvm/cmake/config-ix.cmake.
-    platforms   =
-      lib.platforms.aarch64 ++
-      lib.platforms.arm ++
-      lib.platforms.mips ++
-      lib.platforms.power ++
-      lib.platforms.s390x ++
-      lib.platforms.wasi ++
-      lib.platforms.x86;
-  };
-
-  tools = lib.makeExtensible (tools: let
-    callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch buildLlvmTools; });
-    mkExtraBuildCommands = cc: ''
-      rsrc="$out/resource-root"
-      mkdir "$rsrc"
-      ln -s "${cc.lib}/lib/clang/${release_version}/include" "$rsrc"
-      echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
-      ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
-    '';
-
-  in {
-
-    libllvm = callPackage ./llvm {
-      inherit llvm_meta;
-    };
-
-    # `llvm` historically had the binaries.  When choosing an output explicitly,
-    # we need to reintroduce `outputSpecified` to get the expected behavior e.g. of lib.get*
-    llvm = tools.libllvm;
-
-    libllvm-polly = callPackage ./llvm {
-      inherit llvm_meta;
-      enablePolly = true;
-    };
-
-    llvm-polly = tools.libllvm-polly.lib // { outputSpecified = false; };
-
-    libclang = callPackage ./clang {
-      inherit clang-tools-extra_src llvm_meta;
-    };
-
-    clang-unwrapped = tools.libclang;
-
-    llvm-manpages = lowPrio (tools.libllvm.override {
-      enableManpages = true;
-      python3 = pkgs.python3;  # don't use python-boot
-    });
-
-    clang-manpages = lowPrio (tools.libclang.override {
-      enableManpages = true;
-      python3 = pkgs.python3;  # don't use python-boot
-    });
-
-    # pick clang appropriate for package set we are targeting
-    clang =
-      /**/ if stdenv.targetPlatform.libc == null then tools.clangNoLibc
-      else if stdenv.targetPlatform.useLLVM or false then tools.clangUseLLVM
-      else if (pkgs.targetPackages.stdenv or stdenv).cc.isGNU then tools.libstdcxxClang
-      else tools.libcxxClang;
-
-    libstdcxxClang = wrapCCWith rec {
-      cc = tools.clang-unwrapped;
-      # libstdcxx is taken from gcc in an ad-hoc way in cc-wrapper.
-      libcxx = null;
-      extraPackages = [
-        targetLlvmLibraries.compiler-rt
-      ];
-      extraBuildCommands = mkExtraBuildCommands cc;
-    };
-
-    libcxxClang = wrapCCWith rec {
-      cc = tools.clang-unwrapped;
-      libcxx = targetLlvmLibraries.libcxx;
-      extraPackages = [
-        libcxx.cxxabi
-        targetLlvmLibraries.compiler-rt
-      ];
-      extraBuildCommands = mkExtraBuildCommands cc;
-    };
-
-    lld = callPackage ./lld {
-      inherit llvm_meta;
-    };
-
-    lldb = callPackage ./lldb {
-      inherit llvm_meta;
-    };
-  });
-
-  libraries = lib.makeExtensible (libraries: let
-    callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; });
-  in {
-
-    compiler-rt = callPackage ./compiler-rt {
-      inherit llvm_meta;
-    };
-
-    stdenv = overrideCC stdenv buildLlvmTools.clang;
-
-    libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang;
-
-    libcxx = callPackage ./libcxx {
-      inherit llvm_meta;
-    };
-
-    libcxxabi = callPackage ./libcxxabi {
-      inherit llvm_meta;
-    };
-
-    openmp = callPackage ./openmp {
-      inherit llvm_meta targetLlvm;
-    };
-  });
-  noExtend = extensible: lib.attrsets.removeAttrs extensible [ "extend" ];
-
-in { inherit tools libraries release_version; } // (noExtend libraries) // (noExtend tools)
diff --git a/pkgs/development/compilers/llvm/5/libcxx/default.nix b/pkgs/development/compilers/llvm/5/libcxx/default.nix
deleted file mode 100644
index 073787e92db6..000000000000
--- a/pkgs/development/compilers/llvm/5/libcxx/default.nix
+++ /dev/null
@@ -1,79 +0,0 @@
-{ lib, stdenv, llvm_meta, fetch, cmake, python3, fixDarwinDylibNames, version
-, cxxabi ? if stdenv.hostPlatform.isFreeBSD then libcxxrt else libcxxabi
-, libcxxabi, libcxxrt
-}:
-
-assert stdenv.isDarwin -> cxxabi.pname == "libcxxabi";
-
-stdenv.mkDerivation {
-  pname = "libcxx";
-  inherit version;
-
-  src = fetch "libcxx" "1672aaf95fgy4xsfra8pw24f6r93zwzpan1033hkcm8p2glqipvf";
-
-  postUnpack = ''
-    unpackFile ${libcxxabi.src}
-    export LIBCXXABI_INCLUDE_DIR="$PWD/$(ls -d libcxxabi-${version}*)/include"
-  '';
-
-  outputs = [ "out" "dev" ];
-
-  patches = [
-    ./gnu-install-dirs.patch
-  ] ++ lib.optionals stdenv.hostPlatform.isMusl [
-    ../../libcxx-0001-musl-hacks.patch
-  ];
-
-  prePatch = ''
-    substituteInPlace lib/CMakeLists.txt --replace "/usr/lib/libc++" "\''${LIBCXX_LIBCXXABI_LIB_PATH}/libc++"
-  '';
-
-  preConfigure = ''
-    # Get headers from the cxxabi source so we can see private headers not installed by the cxxabi package
-    cmakeFlagsArray=($cmakeFlagsArray -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$LIBCXXABI_INCLUDE_DIR")
-  '' + lib.optionalString stdenv.hostPlatform.isMusl ''
-    patchShebangs utils/cat_files.py
-  '';
-  nativeBuildInputs = [ cmake ]
-    ++ lib.optional stdenv.hostPlatform.isMusl python3
-    ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
-
-  buildInputs = [ cxxabi ];
-
-  cmakeFlags = [
-    "-DLIBCXX_LIBCPPABI_VERSION=2"
-    "-DLIBCXX_CXX_ABI=${cxxabi.pname}"
-  ] ++ lib.optional stdenv.hostPlatform.isMusl "-DLIBCXX_HAS_MUSL_LIBC=1"
-    ++ lib.optional (cxxabi.pname == "libcxxabi") "-DLIBCXX_LIBCXXABI_LIB_PATH=${cxxabi}/lib";
-
-  preInstall = lib.optionalString (stdenv.isDarwin) ''
-    for file in lib/*.dylib; do
-      if [ -L "$file" ]; then continue; fi
-
-      baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))
-      installName="$out/lib/$baseName"
-      abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/')
-
-      for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
-        ${stdenv.cc.targetPrefix}install_name_tool -change $other ${cxxabi}/lib/$abiName $file
-      done
-    done
-  '';
-
-  passthru = {
-    isLLVM = true;
-    inherit cxxabi;
-  };
-
-  meta = llvm_meta // {
-    homepage = "https://libcxx.llvm.org/";
-    description = "C++ standard library";
-    longDescription = ''
-      libc++ is an implementation of the C++ standard library, targeting C++11,
-      C++14 and above.
-    '';
-    # "All of the code in libc++ is dual licensed under the MIT license and the
-    # UIUC License (a BSD-like license)":
-    license = with lib.licenses; [ mit ncsa ];
-  };
-}
diff --git a/pkgs/development/compilers/llvm/5/libcxx/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/5/libcxx/gnu-install-dirs.patch
deleted file mode 100644
index d9ea0dc7dfd0..000000000000
--- a/pkgs/development/compilers/llvm/5/libcxx/gnu-install-dirs.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index ca5afba86d19..ed69e4043c3d 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -22,6 +22,8 @@ set(CMAKE_MODULE_PATH
- if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
-   project(libcxx CXX C)
- 
-+  include(GNUInstallDirs)
-+
-   set(PACKAGE_NAME libcxx)
-   set(PACKAGE_VERSION 5.0.0)
-   set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
-diff --git a/cmake/Modules/HandleLibCXXABI.cmake b/cmake/Modules/HandleLibCXXABI.cmake
-index b1f6bee8f945..1b455fceed7f 100644
---- a/cmake/Modules/HandleLibCXXABI.cmake
-+++ b/cmake/Modules/HandleLibCXXABI.cmake
-@@ -55,7 +55,7 @@ macro(setup_abi_lib abidefines abilib abifiles abidirs)
-           )
-         if (LIBCXX_INSTALL_HEADERS)
-           install(FILES "${LIBCXX_BINARY_INCLUDE_DIR}/${fpath}"
--            DESTINATION ${LIBCXX_INSTALL_PREFIX}include/c++/v1/${dstdir}
-+            DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1/${dstdir}
-             COMPONENT libcxx
-             PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-             )
-diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
-index 5a1b2ccdc426..106d3d6c1d3c 100644
---- a/include/CMakeLists.txt
-+++ b/include/CMakeLists.txt
-@@ -20,7 +20,7 @@ endif()
- 
- if (LIBCXX_INSTALL_HEADERS)
-   install(DIRECTORY .
--    DESTINATION ${LIBCXX_INSTALL_PREFIX}include/c++/v1
-+    DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1
-     COMPONENT cxx-headers
-     FILES_MATCHING
-     ${LIBCXX_HEADER_PATTERN}
-@@ -44,7 +44,7 @@ if (LIBCXX_INSTALL_HEADERS)
-     set(generated_config_deps generate_config_header)
-     # Install the generated header as __config.
-     install(FILES ${LIBCXX_BINARY_DIR}/__generated_config
--      DESTINATION ${LIBCXX_INSTALL_PREFIX}include/c++/v1
-+      DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1
-       PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-       RENAME __config
-       COMPONENT cxx-headers)
-diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
-index 578651423f3b..277befd631ac 100644
---- a/lib/CMakeLists.txt
-+++ b/lib/CMakeLists.txt
-@@ -355,8 +355,8 @@ if (LIBCXX_INSTALL_LIBRARY)
-     set(experimental_lib cxx_experimental)
-   endif()
-   install(TARGETS ${LIBCXX_TARGETS} ${experimental_lib}
--    LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx
--    ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx
-+    LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx
-+    ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx
-     )
-   # NOTE: This install command must go after the cxx install command otherwise
-   # it will not be executed after the library symlinks are installed.
-@@ -364,7 +364,7 @@ if (LIBCXX_INSTALL_LIBRARY)
-     # Replace the libc++ filename with $<TARGET_LINKER_FILE:cxx>
-     # after we required CMake 3.0.
-     install(FILES "${LIBCXX_LIBRARY_DIR}/libc++${CMAKE_SHARED_LIBRARY_SUFFIX}"
--      DESTINATION ${LIBCXX_INSTALL_PREFIX}lib${LIBCXX_LIBDIR_SUFFIX}
-+      DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX}
-       COMPONENT libcxx)
-   endif()
- endif()
diff --git a/pkgs/development/compilers/llvm/5/libcxxabi/default.nix b/pkgs/development/compilers/llvm/5/libcxxabi/default.nix
deleted file mode 100644
index cc2ac1beaf0c..000000000000
--- a/pkgs/development/compilers/llvm/5/libcxxabi/default.nix
+++ /dev/null
@@ -1,70 +0,0 @@
-{ lib, stdenv, llvm_meta, cmake, fetch, libcxx, libunwind, llvm, version }:
-
-stdenv.mkDerivation {
-  pname = "libcxxabi";
-  inherit version;
-
-  src = fetch "libcxxabi" "12lp799rskr4fc2xr64qn4jfkjnfd8b1aymvsxyn4k9ar7r9pgqv";
-
-  outputs = [ "out" "dev" ];
-
-  postUnpack = ''
-    unpackFile ${libcxx.src}
-    unpackFile ${llvm.src}
-    export cmakeFlags="-DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_PATH=$PWD/$(ls -d libcxx-*)"
-  '' + lib.optionalString stdenv.isDarwin ''
-    export TRIPLE=x86_64-apple-darwin
-  '' + lib.optionalString stdenv.hostPlatform.isMusl ''
-    patch -p1 -d $(ls -d libcxx-*) -i ${../../libcxx-0001-musl-hacks.patch}
-  '';
-
-  patches = [
-    ./gnu-install-dirs.patch
-  ];
-
-  nativeBuildInputs = [ cmake ];
-  buildInputs = lib.optional (!stdenv.isDarwin) libunwind;
-
-  preInstall = lib.optionalString stdenv.isDarwin ''
-    for file in lib/*.dylib; do
-      if [ -L "$file" ]; then continue; fi
-
-      # Fix up the install name. Preserve the basename, just replace the path.
-      installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))"
-
-      # this should be done in CMake, but having trouble figuring out
-      # the magic combination of necessary CMake variables
-      # if you fancy a try, take a look at
-      # https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling
-      ${stdenv.cc.targetPrefix}install_name_tool -id $installName $file
-
-      # cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes
-      # libcxxabi to sometimes link against a different version of itself.
-      # Here we simply make that second reference point to ourselves.
-      for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
-        ${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file
-      done
-    done
-  '';
-
-  postInstall = ''
-    mkdir -p "$dev/include"
-    install -m 644 ../include/${if stdenv.isDarwin then "*" else "cxxabi.h"} "$dev/include"
-  '';
-
-  passthru = {
-    libName = "c++abi";
-  };
-
-  meta = llvm_meta // {
-    homepage = "https://libcxxabi.llvm.org/";
-    description = "Provides C++ standard library support";
-    longDescription = ''
-      libc++abi is a new implementation of low level support for a standard C++ library.
-    '';
-    # "All of the code in libc++abi is dual licensed under the MIT license and
-    # the UIUC License (a BSD-like license)":
-    license = with lib.licenses; [ mit ncsa ];
-    maintainers = llvm_meta.maintainers ++ [ lib.maintainers.vlstill ];
-  };
-}
diff --git a/pkgs/development/compilers/llvm/5/libcxxabi/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/5/libcxxabi/gnu-install-dirs.patch
deleted file mode 100644
index 760d7194f7b9..000000000000
--- a/pkgs/development/compilers/llvm/5/libcxxabi/gnu-install-dirs.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 4db3328deb9c..74b39acfe588 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -20,6 +20,8 @@ set(CMAKE_MODULE_PATH
- if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
-   project(libcxxabi CXX C)
- 
-+  include(GNUInstallDirs)
-+
-   set(PACKAGE_NAME libcxxabi)
-   set(PACKAGE_VERSION 5.0.0)
-   set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
-diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
-index adcc412880c9..71758665af05 100644
---- a/src/CMakeLists.txt
-+++ b/src/CMakeLists.txt
-@@ -174,8 +174,8 @@ endif()
- add_custom_target(cxxabi DEPENDS ${LIBCXXABI_TARGETS})
- 
- install(TARGETS ${LIBCXXABI_TARGETS}
--  LIBRARY DESTINATION ${LIBCXXABI_INSTALL_PREFIX}lib${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi
--  ARCHIVE DESTINATION ${LIBCXXABI_INSTALL_PREFIX}lib${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi
-+  LIBRARY DESTINATION ${LIBCXXABI_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi
-+  ARCHIVE DESTINATION ${LIBCXXABI_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi
-   )
- 
- if (NOT CMAKE_CONFIGURATION_TYPES)
diff --git a/pkgs/development/compilers/llvm/5/lld/default.nix b/pkgs/development/compilers/llvm/5/lld/default.nix
deleted file mode 100644
index d3cbede8433a..000000000000
--- a/pkgs/development/compilers/llvm/5/lld/default.nix
+++ /dev/null
@@ -1,46 +0,0 @@
-{ lib, stdenv, llvm_meta
-, buildLlvmTools
-, fetch
-, cmake
-, libllvm
-, version
-}:
-
-stdenv.mkDerivation rec {
-  pname = "lld";
-  inherit version;
-
-  src = fetch "lld" "1ah75rjly6747jk1zbwca3z0svr9b09ylgxd4x9ns721xir6sia6";
-
-  patches = [
-    ./gnu-install-dirs.patch
-  ];
-
-  nativeBuildInputs = [ cmake ];
-  buildInputs = [ libllvm ];
-
-  cmakeFlags = [
-    "-DLLVM_CONFIG_PATH=${libllvm.dev}/bin/llvm-config${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-native"}"
-  ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
-    "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen"
-  ];
-
-  # Musl's default stack size is too small for lld to be able to link Firefox.
-  LDFLAGS = lib.optionalString stdenv.hostPlatform.isMusl "-Wl,-z,stack-size=2097152";
-
-  outputs = [ "out" "lib" "dev" ];
-
-  meta = llvm_meta // {
-    broken = stdenv.isDarwin;
-    homepage = "https://lld.llvm.org/";
-    description = "The LLVM linker (unwrapped)";
-    longDescription = ''
-      LLD is a linker from the LLVM project that is a drop-in replacement for
-      system linkers and runs much faster than them. It also provides features
-      that are useful for toolchain developers.
-      The linker supports ELF (Unix), PE/COFF (Windows), and Mach-O (macOS)
-      in descending order of completeness. Internally, LLD consists
-      of several different linkers.
-    '';
-  };
-}
diff --git a/pkgs/development/compilers/llvm/5/lld/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/5/lld/gnu-install-dirs.patch
deleted file mode 100644
index ed673870dec5..000000000000
--- a/pkgs/development/compilers/llvm/5/lld/gnu-install-dirs.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index e2ab0e35f1ab..f68e23d2a70d 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -6,6 +6,8 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
-   set(CMAKE_INCLUDE_CURRENT_DIR ON)
-   set(LLD_BUILT_STANDALONE TRUE)
- 
-+  include(GNUInstallDirs)
-+
-   find_program(LLVM_CONFIG_PATH "llvm-config" DOC "Path to llvm-config binary")
-   if(NOT LLVM_CONFIG_PATH)
-     message(FATAL_ERROR "llvm-config not found: specify LLVM_CONFIG_PATH")
-@@ -203,7 +205,7 @@ include_directories(BEFORE
- 
- if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
-   install(DIRECTORY include/
--    DESTINATION include
-+    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
-     FILES_MATCHING
-     PATTERN "*.h"
-     PATTERN ".svn" EXCLUDE
-diff --git a/cmake/modules/AddLLD.cmake b/cmake/modules/AddLLD.cmake
-index fd1d44199ca6..2ec1831ed8f6 100644
---- a/cmake/modules/AddLLD.cmake
-+++ b/cmake/modules/AddLLD.cmake
-@@ -20,9 +20,9 @@ macro(add_lld_library name)
-     install(TARGETS ${name}
-       COMPONENT ${name}
-       ${export_to_lldtargets}
--      LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
--      ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
--      RUNTIME DESTINATION bin)
-+      LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}
-+      ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}
-+      RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
- 
-     if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES)
-       add_custom_target(install-${name}
-@@ -56,7 +56,7 @@ macro(add_lld_tool name)
- 
-     install(TARGETS ${name}
-       ${export_to_lldtargets}
--      RUNTIME DESTINATION bin
-+      RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
-       COMPONENT ${name})
- 
-     if(NOT CMAKE_CONFIGURATION_TYPES)
-@@ -73,5 +73,5 @@ endmacro()
- macro(add_lld_symlink name dest)
-   add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE)
-   # Always generate install targets
--  llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE)
-+  llvm_install_symlink(${name} ${dest} ${CMAKE_INSTALL_FULL_BINDIR} ALWAYS_GENERATE)
- endmacro()
-diff --git a/tools/lld/CMakeLists.txt b/tools/lld/CMakeLists.txt
-index 2df10697ff66..94aa8d092220 100644
---- a/tools/lld/CMakeLists.txt
-+++ b/tools/lld/CMakeLists.txt
-@@ -13,7 +13,7 @@ target_link_libraries(lld
-   )
- 
- install(TARGETS lld
--  RUNTIME DESTINATION bin)
-+  RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
- 
- if(NOT LLD_SYMLINKS_TO_CREATE)
-   set(LLD_SYMLINKS_TO_CREATE lld-link ld.lld)
diff --git a/pkgs/development/compilers/llvm/5/lldb/default.nix b/pkgs/development/compilers/llvm/5/lldb/default.nix
deleted file mode 100644
index 6c60a44b3d65..000000000000
--- a/pkgs/development/compilers/llvm/5/lldb/default.nix
+++ /dev/null
@@ -1,88 +0,0 @@
-{ lib, stdenv, llvm_meta
-, fetch
-, fetchpatch
-, cmake
-, zlib
-, ncurses
-, swig
-, which
-, libedit
-, libxml2
-, libllvm
-, libclang
-, python3
-, version
-, darwin
-}:
-
-stdenv.mkDerivation rec {
-  pname = "lldb";
-  inherit version;
-
-  src = fetch "lldb" "05j2a63yzln43852nng8a7y47spzlyr1cvdmgmbxgd29c8r0bfkq";
-
-  patches = [
-    # Fix PythonString::GetString for >=python-3.7
-    (fetchpatch {
-      url = "https://github.com/llvm/llvm-project/commit/5457b426f5e15a29c0acc8af1a476132f8be2a36.patch";
-      sha256 = "1zbx4m0m8kbg0wq6740jcw151vb2pb1p25p401wiq8diqqagkjps";
-      stripLen = 1;
-    })
-    ./gnu-install-dirs.patch
-  ];
-
-  postPatch = ''
-    # Fix up various paths that assume llvm and clang are installed in the same place
-    sed -i 's,".*ClangConfig.cmake","${libclang.dev}/lib/cmake/clang/ClangConfig.cmake",' \
-      cmake/modules/LLDBStandalone.cmake
-    sed -i 's,".*tools/clang/include","${libclang.dev}/include",' \
-      cmake/modules/LLDBStandalone.cmake
-    sed -i 's,"$.LLVM_LIBRARY_DIR.",${libllvm.lib}/lib ${libclang.lib}/lib,' \
-      cmake/modules/LLDBStandalone.cmake
-  '';
-
-  outputs = [ "out" "lib" "dev" ];
-
-  nativeBuildInputs = [
-    cmake python3 which swig
-  ];
-
-  buildInputs = [
-    ncurses zlib libedit libxml2 libllvm
-  ] ++ lib.optionals stdenv.isDarwin [
-    darwin.libobjc
-    darwin.apple_sdk.libs.xpc
-    darwin.apple_sdk.frameworks.Foundation darwin.bootstrap_cmds darwin.apple_sdk.frameworks.Carbon darwin.apple_sdk.frameworks.Cocoa
-  ];
-
-  CXXFLAGS = "-fno-rtti";
-  hardeningDisable = [ "format" ];
-
-  cmakeFlags = [
-    "-DLLDB_INCLUDE_TESTS=${if doCheck then "YES" else "NO"}"
-    "-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic
-  ] ++ lib.optionals doCheck [
-    "-DLLDB_TEST_C_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"
-    "-DLLDB_TEST_CXX_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++"
-  ];
-
-  doCheck = false;
-
-  postInstall = ''
-    mkdir -p $out/share/man/man1
-    cp ../docs/lldb.1 $out/share/man/man1/
-  '';
-
-  meta = llvm_meta // {
-    homepage = "https://lldb.llvm.org/";
-    description = "A next-generation high-performance debugger";
-    longDescription = ''
-      LLDB is a next generation, high-performance debugger. It is built as a set
-      of reusable components which highly leverage existing libraries in the
-      larger LLVM Project, such as the Clang expression parser and LLVM
-      disassembler.
-    '';
-    # never built on aarch64-darwin since first introduction in nixpkgs
-    broken = stdenv.isDarwin && stdenv.isAarch64;
-  };
-}
diff --git a/pkgs/development/compilers/llvm/5/lldb/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/5/lldb/gnu-install-dirs.patch
deleted file mode 100644
index 5c6193b028fa..000000000000
--- a/pkgs/development/compilers/llvm/5/lldb/gnu-install-dirs.patch
+++ /dev/null
@@ -1,76 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index ada293811b3e..6c2149309f65 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -7,6 +7,8 @@ set(CMAKE_MODULE_PATH
-   "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules"
-   )
- 
-+include(GNUInstallDirs)
-+
- include(LLDBStandalone)
- include(LLDBConfig)
- include(AddLLDB)
-diff --git a/cmake/modules/AddLLDB.cmake b/cmake/modules/AddLLDB.cmake
-index 4c6f1efd673d..179a12b49cce 100644
---- a/cmake/modules/AddLLDB.cmake
-+++ b/cmake/modules/AddLLDB.cmake
-@@ -54,14 +54,14 @@ function(add_lldb_library name)
-         endif()
-         install(TARGETS ${name}
-           COMPONENT ${name}
--          RUNTIME DESTINATION bin
-+          RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
-           LIBRARY DESTINATION ${out_dir}
-           ARCHIVE DESTINATION ${out_dir})
-       else()
-         install(TARGETS ${name}
-           COMPONENT ${name}
--          LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
--          ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
-+          LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}
-+          ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX})
-       endif()
-       if (NOT CMAKE_CONFIGURATION_TYPES)
-         add_custom_target(install-${name}
-@@ -126,7 +126,7 @@ function(add_lldb_executable name)
-   if(ARG_GENERATE_INSTALL AND NOT (ARG_INCLUDE_IN_FRAMEWORK AND LLDB_BUILD_FRAMEWORK ))
-     install(TARGETS ${name}
-           COMPONENT ${name}
--          RUNTIME DESTINATION bin)
-+          RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
-     if (NOT CMAKE_CONFIGURATION_TYPES)
-       add_custom_target(install-${name}
-                         DEPENDS ${name}
-diff --git a/cmake/modules/LLDBConfig.cmake b/cmake/modules/LLDBConfig.cmake
-index 726552675f47..f1f769f34446 100644
---- a/cmake/modules/LLDBConfig.cmake
-+++ b/cmake/modules/LLDBConfig.cmake
-@@ -276,7 +276,7 @@ include_directories(BEFORE
- if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
-   install(DIRECTORY include/
-     COMPONENT lldb_headers
--    DESTINATION include
-+    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
-     FILES_MATCHING
-     PATTERN "*.h"
-     PATTERN ".svn" EXCLUDE
-@@ -286,7 +286,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
- 
-   install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/
-     COMPONENT lldb_headers
--    DESTINATION include
-+    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
-     FILES_MATCHING
-     PATTERN "*.h"
-     PATTERN ".svn" EXCLUDE
-diff --git a/tools/intel-mpx/CMakeLists.txt b/tools/intel-mpx/CMakeLists.txt
-index 29ba9a1cacec..30e2f9334b95 100644
---- a/tools/intel-mpx/CMakeLists.txt
-+++ b/tools/intel-mpx/CMakeLists.txt
-@@ -12,4 +12,4 @@ target_link_libraries(lldb-intel-mpxtable
-                       PUBLIC liblldb LLVMSupport)
- 
- install(TARGETS lldb-intel-mpxtable
--  LIBRARY DESTINATION bin)
-+  LIBRARY DESTINATION ${CMAKE_INSTALL_BINDIR})
diff --git a/pkgs/development/compilers/llvm/5/llvm/default.nix b/pkgs/development/compilers/llvm/5/llvm/default.nix
deleted file mode 100644
index 74523490244f..000000000000
--- a/pkgs/development/compilers/llvm/5/llvm/default.nix
+++ /dev/null
@@ -1,283 +0,0 @@
-{ lib, stdenv, llvm_meta
-, pkgsBuildBuild
-, fetch
-, fetchpatch
-, cmake
-, python3
-, libffi
-, enableGoldPlugin ? libbfd.hasPluginAPI
-, libbfd
-, libxml2
-, ncurses
-, version
-, release_version
-, zlib
-, buildLlvmTools
-, debugVersion ? false
-, enableManpages ? false
-, enableSharedLibraries ? !enableManpages
-, enablePolly ? false
-}:
-
-let
-  inherit (lib) optional optionals optionalString;
-
-  # Used when creating a versioned symlinks of libLLVM.dylib
-  versionSuffixes = with lib;
-    let parts = splitVersion release_version; in
-    imap (i: _: concatStringsSep "." (take i parts)) parts;
-in
-
-stdenv.mkDerivation (rec {
-  pname = "llvm";
-  inherit version;
-
-  src = fetch "llvm" "0g1bbj2n6xv4p1n6hh17vj3vpvg56wacipc81dgwga9mg2lys8nm";
-  polly_src = fetch "polly" "1f4i1qsw7ywx25v262p8syz339zcbvfkx295xz26hmqrn944xa6x";
-
-  unpackPhase = ''
-    unpackFile $src
-    mv llvm-${version}* llvm
-    sourceRoot=$PWD/llvm
-  '' + optionalString enablePolly ''
-    unpackFile $polly_src
-    mv polly-* $sourceRoot/tools/polly
-  '';
-
-  outputs = [ "out" "lib" "dev" "python" ];
-
-  nativeBuildInputs = [ cmake python3 ]
-    ++ optional enableManpages python3.pkgs.sphinx;
-
-  buildInputs = [ libxml2 libffi ];
-
-  propagatedBuildInputs = [ ncurses zlib ];
-
-  patches = [
-    (fetchpatch {
-      url = "https://bugzilla.redhat.com/attachment.cgi?id=1389687";
-      name = "llvm-gcc8-type-mismatch.patch";
-      sha256 = "0ga2123aclq3x9w72d0rm0az12m8c1i4r1106vh701hf4cghgbch";
-    })
-    ./fix-gcc9.patch
-    #(fetchpatch {
-    #  name = "llvm-fix-gcc9.patch";
-    #  url = "https://reviews.llvm.org/file/data/zs3ck5ryvc5n672fd2kw/PHID-FILE-byoqefzwmkd7qnlip4v2/file";
-    #  sha256 = "0injj1hqgrbcbihhwp2nbal88jfykad30r54f2cdcx7gws2fcy8i";
-    #  stripLen = 1;
-    #})
-
-    # When cross-compiling we configure llvm-config-native with an approximation
-    # of the flags used for the normal LLVM build. To avoid the need for building
-    # a native libLLVM.so (which would fail) we force llvm-config to be linked
-    # statically against the necessary LLVM components always.
-    ../../llvm-config-link-static.patch
-
-    ./gnu-install-dirs.patch
-
-    # Fix invalid std::string(nullptr) for GCC 12
-    (fetchpatch {
-      name = "nvptx-gcc-12.patch";
-      url = "https://github.com/llvm/llvm-project/commit/99e64623ec9b31def9375753491cc6093c831809.patch";
-      sha256 = "0zjfjgavqzi2ypqwqnlvy6flyvdz8hi1anwv0ybwnm2zqixg7za3";
-      stripLen = 1;
-    })
-
-    ../../llvm-7-musl.patch
-  ] ++ lib.optional enablePolly ./gnu-install-dirs-polly.patch;
-
-  postPatch = optionalString stdenv.isDarwin ''
-    substituteInPlace cmake/modules/AddLLVM.cmake \
-      --replace 'set(_install_name_dir INSTALL_NAME_DIR "@rpath")' "set(_install_name_dir)" \
-      --replace 'set(_install_rpath "@loader_path/../''${CMAKE_INSTALL_LIBDIR}" ''${extra_libdir})' ""
-  '' + ''
-    # FileSystem permissions tests fail with various special bits
-    substituteInPlace unittests/Support/CMakeLists.txt \
-      --replace "Path.cpp" ""
-    rm unittests/Support/Path.cpp
-
-    # llvm-5 does not support dwarf-5 style info, fails on gcc-11.
-    rm test/tools/llvm-symbolizer/print_context.c
-  '' + optionalString stdenv.isAarch64 ''
-    patch -p0 < ${../../aarch64.patch}
-  '' + optionalString stdenv.hostPlatform.isMusl ''
-    patch -p1 -i ${../../TLI-musl.patch}
-    substituteInPlace unittests/Support/CMakeLists.txt \
-      --replace "add_subdirectory(DynamicLibrary)" ""
-    rm unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
-  '' + ''
-    # Tweak tests to ignore namespace part of type to support
-    # gcc-12: https://gcc.gnu.org/PR103598.
-    # The change below mangles strings like:
-    #    CHECK-NEXT: Starting llvm::Function pass manager run.
-    # to:
-    #    CHECK-NEXT: Starting {{.*}}Function pass manager run.
-    for f in \
-      test/Other/new-pass-manager.ll \
-      test/Other/new-pm-defaults.ll \
-      test/Other/new-pm-lto-defaults.ll \
-      test/Other/new-pm-thinlto-defaults.ll \
-      test/Other/pass-pipeline-parsing.ll \
-      test/Transforms/Inline/cgscc-incremental-invalidate.ll \
-      test/Transforms/Inline/clear-analyses.ll \
-      ; do
-      echo "PATCH: $f"
-      substituteInPlace $f \
-        --replace 'Starting llvm::' 'Starting {{.*}}' \
-        --replace 'Finished llvm::' 'Finished {{.*}}'
-    done
-  '';
-
-  preConfigure = ''
-    # Workaround for configure flags that need to have spaces
-    cmakeFlagsArray+=(
-      -DLLVM_LIT_ARGS='-svj''${NIX_BUILD_CORES} --no-progress-bar'
-    )
-  '';
-
-  # hacky fix: created binaries need to be run before installation
-  preBuild = ''
-    mkdir -p $out/
-    ln -sv $PWD/lib $out
-  '';
-
-  cmakeBuildType = if debugVersion then "Debug" else "Release";
-
-  cmakeFlags = with stdenv; let
-    # These flags influence llvm-config's BuildVariables.inc in addition to the
-    # general build. We need to make sure these are also passed via
-    # CROSS_TOOLCHAIN_FLAGS_NATIVE when cross-compiling or llvm-config-native
-    # will return different results from the cross llvm-config.
-    #
-    # Some flags don't need to be repassed because LLVM already does so (like
-    # CMAKE_BUILD_TYPE), others are irrelevant to the result.
-    flagsForLlvmConfig = [
-      "-DLLVM_INSTALL_CMAKE_DIR=${placeholder "dev"}/lib/cmake/llvm/"
-      "-DLLVM_ENABLE_RTTI=ON"
-    ] ++ optionals enableSharedLibraries [
-      "-DLLVM_LINK_LLVM_DYLIB=ON"
-    ];
-  in flagsForLlvmConfig ++ [
-    "-DLLVM_INSTALL_UTILS=ON"  # Needed by rustc
-    "-DLLVM_BUILD_TESTS=${if doCheck then "ON" else "OFF"}"
-    "-DLLVM_ENABLE_FFI=ON"
-
-    "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}"
-    "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}"
-    "-DTARGET_TRIPLE=${stdenv.hostPlatform.config}"
-  ]
-  ++ lib.optionals enableManpages [
-    "-DLLVM_BUILD_DOCS=ON"
-    "-DLLVM_ENABLE_SPHINX=ON"
-    "-DSPHINX_OUTPUT_MAN=ON"
-    "-DSPHINX_OUTPUT_HTML=OFF"
-    "-DSPHINX_WARNINGS_AS_ERRORS=OFF"
-  ] ++ lib.optionals (enableGoldPlugin) [
-    "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include"
-  ] ++ lib.optionals (isDarwin) [
-    "-DLLVM_ENABLE_LIBCXX=ON"
-    "-DCAN_TARGET_i386=false"
-  ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
-    "-DCMAKE_CROSSCOMPILING=True"
-    "-DLLVM_TABLEGEN=${buildLlvmTools.llvm}/bin/llvm-tblgen"
-    (
-      let
-        nativeCC = pkgsBuildBuild.targetPackages.stdenv.cc;
-        nativeBintools = nativeCC.bintools.bintools;
-        nativeToolchainFlags = [
-          "-DCMAKE_C_COMPILER=${nativeCC}/bin/${nativeCC.targetPrefix}cc"
-          "-DCMAKE_CXX_COMPILER=${nativeCC}/bin/${nativeCC.targetPrefix}c++"
-          "-DCMAKE_AR=${nativeBintools}/bin/${nativeBintools.targetPrefix}ar"
-          "-DCMAKE_STRIP=${nativeBintools}/bin/${nativeBintools.targetPrefix}strip"
-          "-DCMAKE_RANLIB=${nativeBintools}/bin/${nativeBintools.targetPrefix}ranlib"
-        ];
-        # We need to repass the custom GNUInstallDirs values, otherwise CMake
-        # will choose them for us, leading to wrong results in llvm-config-native
-        nativeInstallFlags = [
-          "-DCMAKE_INSTALL_PREFIX=${placeholder "out"}"
-          "-DCMAKE_INSTALL_BINDIR=${placeholder "out"}/bin"
-          "-DCMAKE_INSTALL_INCLUDEDIR=${placeholder "dev"}/include"
-          "-DCMAKE_INSTALL_LIBDIR=${placeholder "lib"}/lib"
-          "-DCMAKE_INSTALL_LIBEXECDIR=${placeholder "lib"}/libexec"
-        ];
-      in "-DCROSS_TOOLCHAIN_FLAGS_NATIVE:list="
-      + lib.concatStringsSep ";" (lib.concatLists [
-        flagsForLlvmConfig
-        nativeToolchainFlags
-        nativeInstallFlags
-      ])
-    )
-  ];
-
-  postBuild = ''
-    rm -fR $out
-  '';
-
-  preCheck = ''
-    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/lib
-  '';
-
-  postInstall = ''
-    mkdir -p $python/share
-    mv $out/share/opt-viewer $python/share/opt-viewer
-    moveToOutput "bin/llvm-config*" "$dev"
-    substituteInPlace "$dev/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \
-      --replace "\''${_IMPORT_PREFIX}/lib/lib" "$lib/lib/lib" \
-      --replace "$out/bin/llvm-config" "$dev/bin/llvm-config"
-    substituteInPlace "$dev/lib/cmake/llvm/LLVMConfig.cmake" \
-      --replace 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}")' 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}'"$lib"'")'
-  ''
-  + optionalString (stdenv.isDarwin && enableSharedLibraries) ''
-    ${lib.concatMapStringsSep "\n" (v: ''
-      ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${v}.dylib
-    '') versionSuffixes}
-  ''
-  + optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
-    cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native
-  '';
-
-  doCheck = stdenv.isLinux && (!stdenv.isi686)
-    && (stdenv.hostPlatform == stdenv.buildPlatform);
-
-  checkTarget = "check-all";
-
-  requiredSystemFeatures = [ "big-parallel" ];
-  meta = llvm_meta // {
-    homepage = "https://llvm.org/";
-    description = "A collection of modular and reusable compiler and toolchain technologies";
-    longDescription = ''
-      The LLVM Project is a collection of modular and reusable compiler and
-      toolchain technologies. Despite its name, LLVM has little to do with
-      traditional virtual machines. The name "LLVM" itself is not an acronym; it
-      is the full name of the project.
-      LLVM began as a research project at the University of Illinois, with the
-      goal of providing a modern, SSA-based compilation strategy capable of
-      supporting both static and dynamic compilation of arbitrary programming
-      languages. Since then, LLVM has grown to be an umbrella project consisting
-      of a number of subprojects, many of which are being used in production by
-      a wide variety of commercial and open source projects as well as being
-      widely used in academic research. Code in the LLVM project is licensed
-      under the "Apache 2.0 License with LLVM exceptions".
-    '';
-  };
-} // lib.optionalAttrs enableManpages {
-  pname = "llvm-manpages";
-
-  buildPhase = ''
-    make docs-llvm-man
-  '';
-
-  propagatedBuildInputs = [];
-
-  installPhase = ''
-    make -C docs install
-  '';
-
-  outputs = [ "out" ];
-
-  doCheck = false;
-
-  meta = llvm_meta // {
-    description = "man pages for LLVM ${version}";
-  };
-})
diff --git a/pkgs/development/compilers/llvm/5/llvm/fix-gcc9.patch b/pkgs/development/compilers/llvm/5/llvm/fix-gcc9.patch
deleted file mode 100644
index eaf71f1468de..000000000000
--- a/pkgs/development/compilers/llvm/5/llvm/fix-gcc9.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-diff --git a/lib/Target/Mips/MipsFastISel.cpp b/lib/Target/Mips/MipsFastISel.cpp
-index f79cb0e6..c6279046 100644
---- a/lib/Target/Mips/MipsFastISel.cpp
-+++ b/lib/Target/Mips/MipsFastISel.cpp
-@@ -70,6 +70,7 @@
- #include <cassert>
- #include <cstdint>
- #include <new>
-+#include <array>
- 
- #define DEBUG_TYPE "mips-fastisel"
- 
-@@ -1309,13 +1310,13 @@ bool MipsFastISel::fastLowerArguments() {
-     return false;
-   }
- 
--  const ArrayRef<MCPhysReg> GPR32ArgRegs = {Mips::A0, Mips::A1, Mips::A2,
--                                            Mips::A3};
--  const ArrayRef<MCPhysReg> FGR32ArgRegs = {Mips::F12, Mips::F14};
--  const ArrayRef<MCPhysReg> AFGR64ArgRegs = {Mips::D6, Mips::D7};
--  ArrayRef<MCPhysReg>::iterator NextGPR32 = GPR32ArgRegs.begin();
--  ArrayRef<MCPhysReg>::iterator NextFGR32 = FGR32ArgRegs.begin();
--  ArrayRef<MCPhysReg>::iterator NextAFGR64 = AFGR64ArgRegs.begin();
-+   std::array<MCPhysReg, 4> GPR32ArgRegs = {{Mips::A0, Mips::A1, Mips::A2,
-+                                            Mips::A3}};
-+   std::array<MCPhysReg, 2> FGR32ArgRegs = {{Mips::F12, Mips::F14}};
-+   std::array<MCPhysReg, 2> AFGR64ArgRegs = {{Mips::D6, Mips::D7}};
-+   auto NextGPR32 = GPR32ArgRegs.begin();
-+   auto NextFGR32 = FGR32ArgRegs.begin();
-+   auto NextAFGR64 = AFGR64ArgRegs.begin();
- 
-   struct AllocatedReg {
-     const TargetRegisterClass *RC;
diff --git a/pkgs/development/compilers/llvm/5/llvm/gnu-install-dirs-polly.patch b/pkgs/development/compilers/llvm/5/llvm/gnu-install-dirs-polly.patch
deleted file mode 100644
index 40f6fa06036c..000000000000
--- a/pkgs/development/compilers/llvm/5/llvm/gnu-install-dirs-polly.patch
+++ /dev/null
@@ -1,106 +0,0 @@
-diff --git a/tools/polly/CMakeLists.txt b/tools/polly/CMakeLists.txt
-index 9ddc0f7ff81d..7ca45f286d47 100644
---- a/tools/polly/CMakeLists.txt
-+++ b/tools/polly/CMakeLists.txt
-@@ -2,7 +2,11 @@
- if (NOT DEFINED LLVM_MAIN_SRC_DIR)
-   project(Polly)
-   cmake_minimum_required(VERSION 3.4.3)
-+endif()
-+
-+include(GNUInstallDirs)
- 
-+if (NOT DEFINED LLVM_MAIN_SRC_DIR)
-   # Where is LLVM installed?
-   find_package(LLVM CONFIG REQUIRED)
-   set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${LLVM_CMAKE_DIR})
-@@ -157,14 +161,14 @@ include_directories(
- 
- if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
-   install(DIRECTORY include/
--    DESTINATION include
-+    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
-     FILES_MATCHING
-     PATTERN "*.h"
-     PATTERN ".svn" EXCLUDE
-     )
- 
-   install(DIRECTORY ${POLLY_BINARY_DIR}/include/
--    DESTINATION include
-+    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
-     FILES_MATCHING
-     PATTERN "*.h"
-     PATTERN "CMakeFiles" EXCLUDE
-diff --git a/tools/polly/cmake/CMakeLists.txt b/tools/polly/cmake/CMakeLists.txt
-index 969292cd6b00..d7aea77bdd20 100644
---- a/tools/polly/cmake/CMakeLists.txt
-+++ b/tools/polly/cmake/CMakeLists.txt
-@@ -79,18 +79,18 @@ file(GENERATE
- 
- # Generate PollyConfig.cmake for the install tree.
- unset(POLLY_EXPORTS)
--set(POLLY_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
-+set(POLLY_INSTALL_PREFIX "")
- set(POLLY_CONFIG_LLVM_CMAKE_DIR "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}")
--set(POLLY_CONFIG_CMAKE_DIR "${POLLY_INSTALL_PREFIX}/${POLLY_INSTALL_PACKAGE_DIR}")
--set(POLLY_CONFIG_LIBRARY_DIRS "${POLLY_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}")
-+set(POLLY_CONFIG_CMAKE_DIR "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_PREFIX}/${POLLY_INSTALL_PACKAGE_DIR}")
-+set(POLLY_CONFIG_LIBRARY_DIRS "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}")
- if (POLLY_BUNDLED_ISL)
-   set(POLLY_CONFIG_INCLUDE_DIRS
--    "${POLLY_INSTALL_PREFIX}/include"
--    "${POLLY_INSTALL_PREFIX}/include/polly"
-+    "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}"
-+    "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_LIBDIR}/polly"
-     )
- else()
-   set(POLLY_CONFIG_INCLUDE_DIRS
--    "${POLLY_INSTALL_PREFIX}/include"
-+    "${POLLY_INSTALL_PREFIX}${CMAKE_INSTALL_FULL_INCLUDEDIR}"
-     ${ISL_INCLUDE_DIRS}
-     )
- endif()
-@@ -100,12 +100,12 @@ endif()
- foreach(tgt IN LISTS POLLY_CONFIG_EXPORTED_TARGETS)
-   get_target_property(tgt_type ${tgt} TYPE)
-   if (tgt_type STREQUAL "EXECUTABLE")
--    set(tgt_prefix "bin/")
-+    set(tgt_prefix "${CMAKE_INSTALL_BINDIR}/")
-   else()
--    set(tgt_prefix "lib/")
-+    set(tgt_prefix "${CMAKE_INSTALL_LIBDIR}/")
-   endif()
- 
--  set(tgt_path "${CMAKE_INSTALL_PREFIX}/${tgt_prefix}$<TARGET_FILE_NAME:${tgt}>")
-+  set(tgt_path "${tgt_prefix}$<TARGET_FILE_NAME:${tgt}>")
-   file(RELATIVE_PATH tgt_path ${POLLY_CONFIG_CMAKE_DIR} ${tgt_path})
- 
-   if (NOT tgt_type STREQUAL "INTERFACE_LIBRARY")
-diff --git a/tools/polly/cmake/polly_macros.cmake b/tools/polly/cmake/polly_macros.cmake
-index 32bed50bb060..cca5bfff4970 100644
---- a/tools/polly/cmake/polly_macros.cmake
-+++ b/tools/polly/cmake/polly_macros.cmake
-@@ -44,8 +44,8 @@ macro(add_polly_library name)
-   if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LLVMPolly")
-     install(TARGETS ${name}
-       EXPORT LLVMExports
--      LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
--      ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
-+	  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}
-+      ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX})
-   endif()
-   set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name})
- endmacro(add_polly_library)
-diff --git a/tools/polly/lib/External/CMakeLists.txt b/tools/polly/lib/External/CMakeLists.txt
-index 286c04fba287..07905e68f595 100644
---- a/tools/polly/lib/External/CMakeLists.txt
-+++ b/tools/polly/lib/External/CMakeLists.txt
-@@ -268,7 +268,7 @@ if (POLLY_BUNDLED_ISL)
-     install(DIRECTORY
-       ${ISL_SOURCE_DIR}/include/
-       ${ISL_BINARY_DIR}/include/
--      DESTINATION include/polly
-+      DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/polly
-       FILES_MATCHING
-       PATTERN "*.h"
-       PATTERN "CMakeFiles" EXCLUDE
diff --git a/pkgs/development/compilers/llvm/5/llvm/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/5/llvm/gnu-install-dirs.patch
deleted file mode 100644
index 3f6d6acb83f7..000000000000
--- a/pkgs/development/compilers/llvm/5/llvm/gnu-install-dirs.patch
+++ /dev/null
@@ -1,386 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index c1e03aed4809..8b8bbb8c403e 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -279,15 +279,21 @@ if (CMAKE_BUILD_TYPE AND
-   message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
- endif()
- 
-+include(GNUInstallDirs)
-+
- set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
- 
--set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')")
-+set(LLVM_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE STRING
-+    "Path for binary subdirectory (defaults to 'bin')")
- mark_as_advanced(LLVM_TOOLS_INSTALL_DIR)
- 
- set(LLVM_UTILS_INSTALL_DIR "bin" CACHE STRING
-     "Path to install LLVM utilities (enabled by LLVM_INSTALL_UTILS=ON) (defaults to LLVM_TOOLS_INSTALL_DIR)")
- mark_as_advanced(LLVM_TOOLS_INSTALL_DIR)
- 
-+set(LLVM_INSTALL_CMAKE_DIR "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/cmake/llvm" CACHE STRING
-+	"Path for CMake subdirectory (defaults to lib/cmake/llvm)" )
-+
- # They are used as destination of target generators.
- set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
- set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
-@@ -512,9 +518,9 @@ option (LLVM_ENABLE_DOXYGEN "Use doxygen to generate llvm API documentation." OF
- option (LLVM_ENABLE_SPHINX "Use Sphinx to generate llvm documentation." OFF)
- option (LLVM_ENABLE_OCAMLDOC "Build OCaml bindings documentation." ON)
- 
--set(LLVM_INSTALL_DOXYGEN_HTML_DIR "share/doc/llvm/doxygen-html"
-+set(LLVM_INSTALL_DOXYGEN_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/doxygen-html"
-     CACHE STRING "Doxygen-generated HTML documentation install directory")
--set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "share/doc/llvm/ocaml-html"
-+set(LLVM_INSTALL_OCAMLDOC_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/ocaml-html"
-     CACHE STRING "OCamldoc-generated HTML documentation install directory")
- 
- option (LLVM_BUILD_EXTERNAL_COMPILER_RT
-@@ -945,7 +951,7 @@ add_subdirectory(cmake/modules)
- 
- if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
-   install(DIRECTORY include/llvm include/llvm-c
--    DESTINATION include
-+    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
-     COMPONENT llvm-headers
-     FILES_MATCHING
-     PATTERN "*.def"
-@@ -957,7 +963,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
-     )
- 
-   install(DIRECTORY ${LLVM_INCLUDE_DIR}/llvm
--    DESTINATION include
-+    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
-     COMPONENT llvm-headers
-     FILES_MATCHING
-     PATTERN "*.def"
-diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
-index 1c922651b133..d555fd627a4f 100644
---- a/cmake/modules/AddLLVM.cmake
-+++ b/cmake/modules/AddLLVM.cmake
-@@ -589,11 +589,11 @@ macro(add_llvm_library name)
-   else()
-     if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LTO" OR
-         (LLVM_LINK_LLVM_DYLIB AND ${name} STREQUAL "LLVM"))
--      set(install_dir lib${LLVM_LIBDIR_SUFFIX})
-+      set(install_dir ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX})
-       if(ARG_SHARED OR BUILD_SHARED_LIBS)
-         if(WIN32 OR CYGWIN OR MINGW)
-           set(install_type RUNTIME)
--          set(install_dir bin)
-+          set(install_dir ${CMAKE_INSTALL_BINDIR})
-         else()
-           set(install_type LIBRARY)
-         endif()
-@@ -637,9 +637,9 @@ macro(add_llvm_loadable_module name)
-       if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
-         if(WIN32 OR CYGWIN)
-           # DLL platform
--          set(dlldir "bin")
-+          set(dlldir "${CMAKE_INSTALL_BINDIR}")
-         else()
--          set(dlldir "lib${LLVM_LIBDIR_SUFFIX}")
-+          set(dlldir "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}")
-         endif()
- 
-         if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
-@@ -651,7 +651,7 @@ macro(add_llvm_loadable_module name)
-         install(TARGETS ${name}
-                 ${export_to_llvmexports}
-                 LIBRARY DESTINATION ${dlldir}
--                ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
-+                ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX})
-       endif()
-       set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name})
-     endif()
-@@ -864,7 +864,7 @@ macro(add_llvm_example name)
-   endif()
-   add_llvm_executable(${name} ${ARGN})
-   if( LLVM_BUILD_EXAMPLES )
--    install(TARGETS ${name} RUNTIME DESTINATION examples)
-+    install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples)
-   endif()
-   set_target_properties(${name} PROPERTIES FOLDER "Examples")
- endmacro(add_llvm_example name)
-@@ -1275,7 +1275,7 @@ function(llvm_install_library_symlink name dest type)
-   set(full_name ${CMAKE_${type}_LIBRARY_PREFIX}${name}${CMAKE_${type}_LIBRARY_SUFFIX})
-   set(full_dest ${CMAKE_${type}_LIBRARY_PREFIX}${dest}${CMAKE_${type}_LIBRARY_SUFFIX})
- 
--  set(output_dir lib${LLVM_LIBDIR_SUFFIX})
-+  set(output_dir ${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX})
-   if(WIN32 AND "${type}" STREQUAL "SHARED")
-     set(output_dir bin)
-   endif()
-@@ -1293,7 +1293,7 @@ function(llvm_install_library_symlink name dest type)
-   endif()
- endfunction()
- 
--function(llvm_install_symlink name dest)
-+function(llvm_install_symlink name dest output_dir)
-   cmake_parse_arguments(ARG "ALWAYS_GENERATE" "COMPONENT" "" ${ARGN})
-   foreach(path ${CMAKE_MODULE_PATH})
-     if(EXISTS ${path}/LLVMInstallSymlink.cmake)
-@@ -1316,7 +1316,7 @@ function(llvm_install_symlink name dest)
-   set(full_dest ${dest}${CMAKE_EXECUTABLE_SUFFIX})
- 
-   install(SCRIPT ${INSTALL_SYMLINK}
--          CODE "install_symlink(${full_name} ${full_dest} ${LLVM_TOOLS_INSTALL_DIR})"
-+          CODE "install_symlink(${full_name} ${full_dest} ${output_dir})"
-           COMPONENT ${component})
- 
-   if (NOT CMAKE_CONFIGURATION_TYPES AND NOT ARG_ALWAYS_GENERATE)
-@@ -1400,7 +1400,8 @@ function(add_llvm_tool_symlink link_name target)
-     endif()
- 
-     if ((TOOL_IS_TOOLCHAIN OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY) AND LLVM_BUILD_TOOLS)
--      llvm_install_symlink(${link_name} ${target})
-+      GNUInstallDirs_get_absolute_install_dir(output_dir LLVM_TOOLS_INSTALL_DIR)
-+      llvm_install_symlink(${link_name} ${target} ${output_dir})
-     endif()
-   endif()
- endfunction()
-@@ -1452,9 +1453,9 @@ function(llvm_setup_rpath name)
- 
-   if (APPLE)
-     set(_install_name_dir INSTALL_NAME_DIR "@rpath")
--    set(_install_rpath "@loader_path/../lib" ${extra_libdir})
-+    set(_install_rpath "@loader_path/../${CMAKE_INSTALL_LIBDIR}" ${extra_libdir})
-   elseif(UNIX)
--    set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-+    set(_install_rpath "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-     if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)")
-       set_property(TARGET ${name} APPEND_STRING PROPERTY
-                    LINK_FLAGS " -Wl,-z,origin ")
-diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake
-index 1d8094cc505f..afdbe6e6d19c 100644
---- a/cmake/modules/AddOCaml.cmake
-+++ b/cmake/modules/AddOCaml.cmake
-@@ -140,9 +140,9 @@ function(add_ocaml_library name)
-   endforeach()
- 
-   if( APPLE )
--    set(ocaml_rpath "@executable_path/../../../lib${LLVM_LIBDIR_SUFFIX}")
-+    set(ocaml_rpath "@executable_path/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}")
-   elseif( UNIX )
--    set(ocaml_rpath "\\$ORIGIN/../../../lib${LLVM_LIBDIR_SUFFIX}")
-+    set(ocaml_rpath "\\$ORIGIN/../../../${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}")
-   endif()
-   list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}")
- 
-diff --git a/cmake/modules/AddSphinxTarget.cmake b/cmake/modules/AddSphinxTarget.cmake
-index 4540c5c36c8e..4cefb17fbd55 100644
---- a/cmake/modules/AddSphinxTarget.cmake
-+++ b/cmake/modules/AddSphinxTarget.cmake
-@@ -73,7 +73,7 @@ function (add_sphinx_target builder project)
- 
-       elseif (builder STREQUAL html)
-         string(TOUPPER "${project}" project_upper)
--        set(${project_upper}_INSTALL_SPHINX_HTML_DIR "share/doc/${project}/html"
-+        set(${project_upper}_INSTALL_SPHINX_HTML_DIR "${CMAKE_INSTALL_DOCDIR}/${project}/html"
-             CACHE STRING "HTML documentation install directory for ${project}")
- 
-         # '/.' indicates: copy the contents of the directory directly into
-diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt
-index ac4b0b7c0304..21a6a3da8667 100644
---- a/cmake/modules/CMakeLists.txt
-+++ b/cmake/modules/CMakeLists.txt
-@@ -1,4 +1,4 @@
--set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm)
-+set(LLVM_INSTALL_PACKAGE_DIR ${LLVM_INSTALL_CMAKE_DIR} CACHE STRING "Path for CMake subdirectory (defaults to 'cmake/llvm')")
- set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}")
- 
- # First for users who use an installed LLVM, create the LLVMExports.cmake file.
-@@ -84,11 +84,11 @@ foreach(p ${_count})
-   set(LLVM_CONFIG_CODE "${LLVM_CONFIG_CODE}
- get_filename_component(LLVM_INSTALL_PREFIX \"\${LLVM_INSTALL_PREFIX}\" PATH)")
- endforeach(p)
--set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/include")
--set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/lib\${LLVM_LIBDIR_SUFFIX}")
-+set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}")
-+set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\${LLVM_LIBDIR_SUFFIX}")
- set(LLVM_CONFIG_CMAKE_DIR "\${LLVM_INSTALL_PREFIX}/${LLVM_INSTALL_PACKAGE_DIR}")
- set(LLVM_CONFIG_BINARY_DIR "\${LLVM_INSTALL_PREFIX}")
--set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/bin")
-+set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}")
- set(LLVM_CONFIG_EXPORTS_FILE "\${LLVM_CMAKE_DIR}/LLVMExports.cmake")
- set(LLVM_CONFIG_EXPORTS "${LLVM_EXPORTS}")
- configure_file(
-diff --git a/cmake/modules/LLVMInstallSymlink.cmake b/cmake/modules/LLVMInstallSymlink.cmake
-index 482697b06baf..af2ac1e6c979 100644
---- a/cmake/modules/LLVMInstallSymlink.cmake
-+++ b/cmake/modules/LLVMInstallSymlink.cmake
-@@ -10,7 +10,7 @@ function(install_symlink name target outdir)
-     set(LINK_OR_COPY copy)
-   endif()
- 
--  set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}/")
-+  set(bindir "${DESTDIR}${outdir}/")
- 
-   message("Creating ${name}")
- 
-diff --git a/docs/CMake.rst b/docs/CMake.rst
-index b6ebf37adc92..34c73d2869e0 100644
---- a/docs/CMake.rst
-+++ b/docs/CMake.rst
-@@ -196,7 +196,7 @@ CMake manual, or execute ``cmake --help-variable VARIABLE_NAME``.
- **LLVM_LIBDIR_SUFFIX**:STRING
-   Extra suffix to append to the directory where libraries are to be
-   installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64``
--  to install libraries to ``/usr/lib64``.
-+  to install libraries to ``/usr/lib64``. See also ``CMAKE_INSTALL_LIBDIR``.
- 
- **CMAKE_C_FLAGS**:STRING
-   Extra flags to use when compiling C source files.
-@@ -461,8 +461,8 @@ LLVM-specific variables
- 
- **LLVM_INSTALL_DOXYGEN_HTML_DIR**:STRING
-   The path to install Doxygen-generated HTML documentation to. This path can
--  either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to
--  `share/doc/llvm/doxygen-html`.
-+  either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to
-+  `${CMAKE_INSTALL_DOCDIR}/${project}/doxygen-html`.
- 
- **LLVM_ENABLE_SPHINX**:BOOL
-   If specified, CMake will search for the ``sphinx-build`` executable and will make
-@@ -493,13 +493,33 @@ LLVM-specific variables
- 
- **LLVM_INSTALL_SPHINX_HTML_DIR**:STRING
-   The path to install Sphinx-generated HTML documentation to. This path can
--  either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to
--  `share/doc/llvm/html`.
-+  either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to
-+  `${CMAKE_INSTALL_DOCDIR}/${project}/html`.
- 
- **LLVM_INSTALL_OCAMLDOC_HTML_DIR**:STRING
-   The path to install OCamldoc-generated HTML documentation to. This path can
--  either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to
--  `share/doc/llvm/ocaml-html`.
-+  either be absolute or relative to the ``CMAKE_INSTALL_PREFIX``. Defaults to
-+  `${CMAKE_INSTALL_DOCDIR}/${project}/ocaml-html`.
-+
-+**CMAKE_INSTALL_BINDIR**:STRING
-+  The path to install binary tools, relative to the ``CMAKE_INSTALL_PREFIX``.
-+  Defaults to `bin`.
-+
-+**CMAKE_INSTALL_LIBDIR**:STRING
-+  The path to install libraries, relative to the ``CMAKE_INSTALL_PREFIX``.
-+  Defaults to `lib`.
-+
-+**CMAKE_INSTALL_INCLUDEDIR**:STRING
-+  The path to install header files, relative to the ``CMAKE_INSTALL_PREFIX``.
-+  Defaults to `include`.
-+
-+**CMAKE_INSTALL_DOCDIR**:STRING
-+  The path to install documentation, relative to the ``CMAKE_INSTALL_PREFIX``.
-+  Defaults to `share/doc`.
-+
-+**CMAKE_INSTALL_MANDIR**:STRING
-+  The path to install manpage files, relative to the ``CMAKE_INSTALL_PREFIX``.
-+  Defaults to `share/man`.
- 
- **LLVM_CREATE_XCODE_TOOLCHAIN**:BOOL
-   OS X Only: If enabled CMake will generate a target named
-@@ -651,9 +671,11 @@ the ``cmake`` command or by setting it directly in ``ccmake`` or ``cmake-gui``).
- 
- This file is available in two different locations.
- 
--* ``<INSTALL_PREFIX>/lib/cmake/llvm/LLVMConfig.cmake`` where
--  ``<INSTALL_PREFIX>`` is the install prefix of an installed version of LLVM.
--  On Linux typically this is ``/usr/lib/cmake/llvm/LLVMConfig.cmake``.
-+* ``<LLVM_INSTALL_PACKAGE_DIR>LLVMConfig.cmake`` where
-+  ``<LLVM_INSTALL_PACKAGE_DIR>`` is the location where LLVM CMake modules are
-+  installed as part of an installed version of LLVM. This is typically
-+  ``cmake/llvm/`` within the lib directory. On Linux, this is typically
-+  ``/usr/lib/cmake/llvm/LLVMConfig.cmake``.
- 
- * ``<LLVM_BUILD_ROOT>/lib/cmake/llvm/LLVMConfig.cmake`` where
-   ``<LLVM_BUILD_ROOT>`` is the root of the LLVM build tree. **Note: this is only
-diff --git a/include/llvm/CMakeLists.txt b/include/llvm/CMakeLists.txt
-index 1d5ca3ba92b0..026f5453c1da 100644
---- a/include/llvm/CMakeLists.txt
-+++ b/include/llvm/CMakeLists.txt
-@@ -4,5 +4,5 @@ add_subdirectory(Support)
- # If we're doing an out-of-tree build, copy a module map for generated
- # header files into the build area.
- if (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
--  configure_file(module.modulemap.build module.modulemap COPYONLY)
-+  configure_file(module.modulemap.build ${LLVM_INCLUDE_DIR}/module.modulemap COPYONLY)
- endif (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
-diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in
-index f201e1f7bff0..4582ed556a02 100644
---- a/tools/llvm-config/BuildVariables.inc.in
-+++ b/tools/llvm-config/BuildVariables.inc.in
-@@ -24,6 +24,10 @@
- #define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@"
- #define LLVM_BUILDMODE "@LLVM_BUILDMODE@"
- #define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@"
-+#define LLVM_INSTALL_BINDIR "@CMAKE_INSTALL_BINDIR@"
-+#define LLVM_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@"
-+#define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@"
-+#define LLVM_INSTALL_CMAKEDIR "@LLVM_INSTALL_CMAKE_DIR@"
- #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
- #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@"
- #define LLVM_BUILD_SYSTEM "@LLVM_BUILD_SYSTEM@"
-diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
-index 08b096afb052..2deae0dcfacc 100644
---- a/tools/llvm-config/llvm-config.cpp
-+++ b/tools/llvm-config/llvm-config.cpp
-@@ -332,12 +332,26 @@ int main(int argc, char **argv) {
-         ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include");
-   } else {
-     ActivePrefix = CurrentExecPrefix;
--    ActiveIncludeDir = ActivePrefix + "/include";
--    SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR));
--    sys::fs::make_absolute(ActivePrefix, path);
--    ActiveBinDir = path.str();
--    ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
--    ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
-+    {
-+      SmallString<256> path(StringRef(LLVM_INSTALL_INCLUDEDIR));
-+      sys::fs::make_absolute(ActivePrefix, path);
-+      ActiveIncludeDir = std::string(path.str());
-+    }
-+    {
-+      SmallString<256> path(StringRef(LLVM_INSTALL_BINDIR));
-+      sys::fs::make_absolute(ActivePrefix, path);
-+      ActiveBinDir = std::string(path.str());
-+    }
-+    {
-+      SmallString<256> path(StringRef(LLVM_INSTALL_LIBDIR LLVM_LIBDIR_SUFFIX));
-+      sys::fs::make_absolute(ActivePrefix, path);
-+      ActiveLibDir = std::string(path.str());
-+    }
-+    {
-+      SmallString<256> path(StringRef(LLVM_INSTALL_CMAKEDIR));
-+      sys::fs::make_absolute(ActivePrefix, path);
-+      ActiveCMakeDir = std::string(path.str());
-+    }
-     ActiveIncludeOption = "-I" + ActiveIncludeDir;
-   }
- 
-diff --git a/tools/lto/CMakeLists.txt b/tools/lto/CMakeLists.txt
-index 6e913519a809..85641eef721f 100644
---- a/tools/lto/CMakeLists.txt
-+++ b/tools/lto/CMakeLists.txt
-@@ -19,7 +19,7 @@ set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/lto.exports)
- add_llvm_library(LTO SHARED ${SOURCES} DEPENDS intrinsics_gen)
- 
- install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h
--  DESTINATION include/llvm-c
-+  DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/llvm-c
-   COMPONENT LTO)
- 
- if (APPLE)
-diff --git a/tools/opt-viewer/CMakeLists.txt b/tools/opt-viewer/CMakeLists.txt
-index 19b606933082..27b9f71b3d79 100644
---- a/tools/opt-viewer/CMakeLists.txt
-+++ b/tools/opt-viewer/CMakeLists.txt
-@@ -8,6 +8,6 @@ set (files
- 
- foreach (file ${files})
-   install(PROGRAMS ${file}
--    DESTINATION share/opt-viewer
-+    DESTINATION ${CMAKE_INSTALL_DATADIR}/opt-viewer
-     COMPONENT opt-viewer)
- endforeach (file)
diff --git a/pkgs/development/compilers/llvm/5/openmp/default.nix b/pkgs/development/compilers/llvm/5/openmp/default.nix
deleted file mode 100644
index 900e920173fb..000000000000
--- a/pkgs/development/compilers/llvm/5/openmp/default.nix
+++ /dev/null
@@ -1,37 +0,0 @@
-{ lib
-, stdenv
-, llvm_meta
-, fetch
-, cmake
-, llvm
-, targetLlvm
-, perl
-, version
-}:
-
-stdenv.mkDerivation {
-  pname = "openmp";
-  inherit version;
-
-  src = fetch "openmp" "0p2n52676wlq6y9q99n5pivq6pvvda1p994r69fxj206ahn59jir";
-
-  nativeBuildInputs = [ cmake perl ];
-  buildInputs = [
-    (if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm)
-  ];
-
-  meta = llvm_meta // {
-    homepage = "https://openmp.llvm.org/";
-    description = "Support for the OpenMP language";
-    longDescription = ''
-      The OpenMP subproject of LLVM contains the components required to build an
-      executable OpenMP program that are outside the compiler itself.
-      Contains the code for the runtime library against which code compiled by
-      "clang -fopenmp" must be linked before it can run and the library that
-      supports offload to target devices.
-    '';
-    # "All of the code is dual licensed under the MIT license and the UIUC
-    # License (a BSD-like license)":
-    license = with lib.licenses; [ mit ncsa ];
-  };
-}
diff --git a/pkgs/development/embedded/blisp/default.nix b/pkgs/development/embedded/blisp/default.nix
index 093e0ef195ca..027ca82324f8 100644
--- a/pkgs/development/embedded/blisp/default.nix
+++ b/pkgs/development/embedded/blisp/default.nix
@@ -32,6 +32,8 @@ stdenv.mkDerivation (finalAttrs: {
     "-DBLISP_USE_SYSTEM_LIBRARIES=ON"
   ];
 
+  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-Wno-error=implicit-function-declaration";
+
   passthru.tests.version = testers.testVersion {
     package = finalAttrs.finalPackage;
     version = "v${finalAttrs.version}";
@@ -42,6 +44,7 @@ stdenv.mkDerivation (finalAttrs: {
     license = licenses.mit;
     mainProgram = "blisp";
     homepage = "https://github.com/pine64/blisp";
+    platforms = platforms.unix;
     maintainers = [ maintainers.bdd ];
   };
 })
diff --git a/pkgs/development/interpreters/python/python2/mk-python-derivation.nix b/pkgs/development/interpreters/python/python2/mk-python-derivation.nix
index 1a6f9c784cf6..6d51b51b215d 100644
--- a/pkgs/development/interpreters/python/python2/mk-python-derivation.nix
+++ b/pkgs/development/interpreters/python/python2/mk-python-derivation.nix
@@ -57,7 +57,8 @@
 # Raise an error if two packages are installed with the same name
 # TODO: For cross we probably need a different PYTHONPATH, or not
 # add the runtime deps until after buildPhase.
-, catchConflicts ? (python.stdenv.hostPlatform == python.stdenv.buildPlatform)
+# FIXME: disabled for Python 2 because broken
+, catchConflicts ? false
 
 # Additional arguments to pass to the makeWrapper function, which wraps
 # generated binaries.
diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix
index 903a101aa490..3ccbe1e855a3 100644
--- a/pkgs/development/interpreters/ruby/default.nix
+++ b/pkgs/development/interpreters/ruby/default.nix
@@ -15,13 +15,6 @@ let
   config = import ./config.nix { inherit fetchFromSavannah; };
   rubygems = import ./rubygems { inherit stdenv lib fetchurl; };
 
-  openssl3Gem = fetchFromGitHub {
-    owner = "ruby";
-    repo = "openssl";
-    rev = "v3.0.2";
-    hash = "sha256-KhuKRP1JkMJv7CagGRQ0KKGOd5Oh0FP0fbj0VZ4utGo=";
-  };
-
   # Contains the ruby version heuristics
   rubyVersion = import ./ruby-version.nix { inherit lib; };
 
@@ -156,12 +149,6 @@ let
           rm -rf $sourceRoot/{lib,test}/rubygems*
           cp -r ${rubygems}/lib/rubygems* $sourceRoot/lib
           cp -r ${rubygems}/test/rubygems $sourceRoot/test
-        '' + opString (ver.majMin == "3.0" && opensslSupport) ''
-          # Replace the Gem by a OpenSSL3-compatible one.
-          echo "Hotpatching the OpenSSL gem with a 3.x series for OpenSSL 3 support..."
-          cp -vr ${openssl3Gem}/ext/openssl $sourceRoot/ext/
-          cp -vr ${openssl3Gem}/lib/ $sourceRoot/ext/openssl/
-          cp -vr ${openssl3Gem}/{History.md,openssl.gemspec} $sourceRoot/ext/openssl/
         '';
 
         postPatch = ''
@@ -334,11 +321,6 @@ in {
     sha256 = "sha256-wtq2PLyPKgVSYQitQZ76Y6Z+1AdNu8+fwrHKZky0W6A=";
   };
 
-  ruby_3_0 = generic {
-    version = rubyVersion "3" "0" "6" "";
-    sha256 = "sha256-bmy9SQAw15EMD/IO3vq0KU380QRvD49H94tZeYesaD4=";
-  };
-
   ruby_3_1 = generic {
     version = rubyVersion "3" "1" "4" "";
     sha256 = "sha256-o9VYeaDfqx1xQf3xDSKgfb+OXNxEFdob3gYSfVzDx7Y=";
diff --git a/pkgs/development/libraries/shapelib/default.nix b/pkgs/development/libraries/shapelib/default.nix
index f0afda7a9001..fe17da91e581 100644
--- a/pkgs/development/libraries/shapelib/default.nix
+++ b/pkgs/development/libraries/shapelib/default.nix
@@ -30,6 +30,6 @@ stdenv.mkDerivation rec {
     description = "C Library for reading, writing and updating ESRI Shapefiles";
     homepage = "http://shapelib.maptools.org/";
     license = licenses.gpl2;
-    maintainers = [ maintainers.ehmry ];
+    maintainers = with maintainers; teams.geospatial.members ++ [ ehmry ];
   };
 }
diff --git a/pkgs/development/python-modules/acquire/default.nix b/pkgs/development/python-modules/acquire/default.nix
index 4426f930b0d8..87e1ef293071 100644
--- a/pkgs/development/python-modules/acquire/default.nix
+++ b/pkgs/development/python-modules/acquire/default.nix
@@ -17,7 +17,7 @@
 
 buildPythonPackage rec {
   pname = "acquire";
-  version = "3.9";
+  version = "3.10";
   pyproject = true;
 
   disabled = pythonOlder "3.9";
@@ -26,7 +26,7 @@ buildPythonPackage rec {
     owner = "fox-it";
     repo = "acquire";
     rev = "refs/tags/${version}";
-    hash = "sha256-ppkfnPJEvCImTA0+NjYD8r6SHcx9eBN9GBvo0IZYcjY=";
+    hash = "sha256-8fvVK/mH+pgPaaxNKvKOw1qU0ElWAmNVP6YAqvBTwio=";
   };
 
   SETUPTOOLS_SCM_PRETEND_VERSION = version;
diff --git a/pkgs/development/python-modules/bbox/default.nix b/pkgs/development/python-modules/bbox/default.nix
index 4f1d0cef7fd0..df28d568b010 100644
--- a/pkgs/development/python-modules/bbox/default.nix
+++ b/pkgs/development/python-modules/bbox/default.nix
@@ -1,23 +1,40 @@
 { lib
 , buildPythonPackage
-, fetchPypi
+, fetchFromGitHub
+, pytestCheckHook
 , pythonOlder
-, pyquaternion
+, matplotlib
 , numpy
+, pendulum
+, pillow
+, poetry-core
+, pyquaternion
 }:
 
 buildPythonPackage rec {
   pname = "bbox";
   version = "0.9.4";
+  pyproject = true;
 
   disabled = pythonOlder "3.6";
 
-  src = fetchPypi {
-    inherit pname version;
-    hash = "sha256-GGQhKkdwmrYPEhtldPY3WUInSniU/B40NZvt1gXEuzg=";
+  src = fetchFromGitHub {
+    owner = "varunagrawal";
+    repo = pname;
+    # matches 0.9.4 on PyPi + tests
+    rev = "d3f07ed0e38b6015cf4181e3b3edae6a263f8565";
+    hash = "sha256-FrJ8FhlqwmnEB/QvPlkDfqZncNGPhwY9aagM9yv1LGs=";
   };
 
   propagatedBuildInputs = [ pyquaternion numpy ];
+  buildInputs = [ poetry-core ];
+
+  nativeCheckInputs = [
+    matplotlib
+    pendulum
+    pillow
+    pytestCheckHook
+  ];
 
   pythonImportsCheck = [ "bbox" ];
 
diff --git a/pkgs/development/python-modules/bork/default.nix b/pkgs/development/python-modules/bork/default.nix
index 5cd247cf2872..2b3b27108d1b 100644
--- a/pkgs/development/python-modules/bork/default.nix
+++ b/pkgs/development/python-modules/bork/default.nix
@@ -1,11 +1,13 @@
 { lib
 , buildPythonPackage
 , fetchFromGitHub
+, pytestCheckHook
 , pythonOlder
 
 , build
 , coloredlogs
 , packaging
+, pip
 , toml
 , twine
 , wheel
@@ -13,21 +15,22 @@
 
 buildPythonPackage rec {
   pname = "bork";
-  version = "7.0.0";
+  version = "7.0.1";
   pyproject = true;
   disabled = pythonOlder "3.8";
 
   src = fetchFromGitHub {
     owner = "duckinator";
     repo = pname;
-    rev = "v${version}";
-    hash = "sha256-frwkU2YesYK0RJNz9yqiXj1XeTZ8jg5oClri4hEYokg=";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-y/p2uuU+QKgJSdJmMt3oebm/zcuatYWTW8Jl79YxA3g=";
   };
 
   propagatedBuildInputs = [
     build
     coloredlogs
     packaging
+    pip
     toml
     twine
     wheel
@@ -39,6 +42,13 @@ buildPythonPackage rec {
     "bork.cli"
   ];
 
+  nativeCheckInputs = [
+    pytestCheckHook
+  ];
+  pytestFlagsArray = [
+    "-m 'not network'"
+  ];
+
   meta = with lib; {
     description = "Python build and release management tool";
     homepage = "https://github.com/duckinator/bork";
diff --git a/pkgs/development/python-modules/brian2/default.nix b/pkgs/development/python-modules/brian2/default.nix
index 2b3bcbff5076..a85e26b485f4 100644
--- a/pkgs/development/python-modules/brian2/default.nix
+++ b/pkgs/development/python-modules/brian2/default.nix
@@ -22,12 +22,6 @@ buildPythonPackage rec {
     hash = "sha256-XMXSOwcH8fLgzXCcT+grjYxhBdtF4H/Vr+S7J4GYZSw=";
   };
 
-  patches = [
-    # Fix deprecated numpy types
-    # https://sources.debian.org/data/main/b/brian/2.5.1-3/debian/patches/numpy1.24.patch
-    ./numpy1.24.patch
-  ];
-
   propagatedBuildInputs = [
     cython
     jinja2
diff --git a/pkgs/development/python-modules/brian2/numpy1.24.patch b/pkgs/development/python-modules/brian2/numpy1.24.patch
deleted file mode 100644
index 01af8f77c0ed..000000000000
--- a/pkgs/development/python-modules/brian2/numpy1.24.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-Description: Remove deprecated use of np.float
-Author: Marcel Stimberg <marcel.stimberg@inserm.fr>
-Bug-Debian: https://bugs.debian.org/1027193
-Applied-Upstream: 61ef84b316a3d0a892298adf51abd8ac50900758
-Last-Update: 2023-01-06
----
-This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---- brian.orig/brian2/units/fundamentalunits.py
-+++ brian/brian2/units/fundamentalunits.py
-@@ -1597,7 +1597,7 @@
-         unitless = np.array(self / best_unit, copy=False)
-         threshold = np.get_printoptions()['threshold'] // 100
-         if unitless.ndim == 0:
--            sympy_quantity = np.float(unitless)
-+            sympy_quantity = float(unitless)
-         elif unitless.ndim == 1:
-             array_str = np.array2string(unitless, separator=" & ", threshold=threshold,
-                                         max_line_width=sys.maxsize)
diff --git a/pkgs/development/python-modules/dissect-fat/default.nix b/pkgs/development/python-modules/dissect-fat/default.nix
index 9fa9457b2848..0a22c7b8b7ba 100644
--- a/pkgs/development/python-modules/dissect-fat/default.nix
+++ b/pkgs/development/python-modules/dissect-fat/default.nix
@@ -10,7 +10,7 @@
 
 buildPythonPackage rec {
   pname = "dissect-fat";
-  version = "3.6";
+  version = "3.7";
   pyproject = true;
 
   disabled = pythonOlder "3.9";
@@ -19,7 +19,7 @@ buildPythonPackage rec {
     owner = "fox-it";
     repo = "dissect.fat";
     rev = "refs/tags/${version}";
-    hash = "sha256-3Zyjo7yoSLtAnC5lOLzjWsqMRoJxsrw2LKjQ2Qy38sg=";
+    hash = "sha256-YfWshytfj4p2MqLpzE3b1/RtrL1/+Xd/5+RNbrH/Jfc=";
   };
 
   SETUPTOOLS_SCM_PRETEND_VERSION = version;
diff --git a/pkgs/development/python-modules/dissect-hypervisor/default.nix b/pkgs/development/python-modules/dissect-hypervisor/default.nix
index 55ce876fe216..e7f17cb0286c 100644
--- a/pkgs/development/python-modules/dissect-hypervisor/default.nix
+++ b/pkgs/development/python-modules/dissect-hypervisor/default.nix
@@ -14,7 +14,7 @@
 
 buildPythonPackage rec {
   pname = "dissect-hypervisor";
-  version = "3.9";
+  version = "3.10";
   pyproject = true;
 
   disabled = pythonOlder "3.9";
@@ -23,7 +23,7 @@ buildPythonPackage rec {
     owner = "fox-it";
     repo = "dissect.hypervisor";
     rev = "refs/tags/${version}";
-    hash = "sha256-AcDlyLKrRyt1mhh7nb9Oln/cjVKw8s1g78J8sgE2p2g=";
+    hash = "sha256-Ml5U7yc4iqqilL6Y9qF3VU+pa0AXnYVQjVas90TpG30=";
   };
 
   SETUPTOOLS_SCM_PRETEND_VERSION = version;
diff --git a/pkgs/development/python-modules/dissect-regf/default.nix b/pkgs/development/python-modules/dissect-regf/default.nix
index 9671bb33c8ab..94881ca3ca42 100644
--- a/pkgs/development/python-modules/dissect-regf/default.nix
+++ b/pkgs/development/python-modules/dissect-regf/default.nix
@@ -11,7 +11,7 @@
 
 buildPythonPackage rec {
   pname = "dissect-regf";
-  version = "3.7";
+  version = "3.8";
   pyproject = true;
 
   disabled = pythonOlder "3.9";
@@ -20,7 +20,7 @@ buildPythonPackage rec {
     owner = "fox-it";
     repo = "dissect.regf";
     rev = "refs/tags/${version}";
-    hash = "sha256-WUrND1RnXTeN3WosR+m+yVJLe/imBTx7nmUZrSIc1E0=";
+    hash = "sha256-4tKu7oPkpNcWr2XJvZg94yZZcbTeeXBphPCLoZYzg6U=";
   };
 
   SETUPTOOLS_SCM_PRETEND_VERSION = version;
diff --git a/pkgs/development/python-modules/dissect-sql/default.nix b/pkgs/development/python-modules/dissect-sql/default.nix
index c7192854fcf8..173170396f72 100644
--- a/pkgs/development/python-modules/dissect-sql/default.nix
+++ b/pkgs/development/python-modules/dissect-sql/default.nix
@@ -11,7 +11,7 @@
 
 buildPythonPackage rec {
   pname = "dissect-sql";
-  version = "3.6";
+  version = "3.7";
   format = "pyproject";
 
   disabled = pythonOlder "3.7";
@@ -20,7 +20,7 @@ buildPythonPackage rec {
     owner = "fox-it";
     repo = "dissect.sql";
     rev = "refs/tags/${version}";
-    hash = "sha256-CMUXMSkrutziAIYjUFbLEpsYpCZUiPmV16puXneGeHE=";
+    hash = "sha256-BHwm88IPtfg/bi5veFGnciQeH4s0asVnxiMVsIi8vV8=";
   };
 
   SETUPTOOLS_SCM_PRETEND_VERSION = version;
diff --git a/pkgs/development/python-modules/flow-record/default.nix b/pkgs/development/python-modules/flow-record/default.nix
index 1562600a231f..2c8de577dc27 100644
--- a/pkgs/development/python-modules/flow-record/default.nix
+++ b/pkgs/development/python-modules/flow-record/default.nix
@@ -15,7 +15,7 @@
 
 buildPythonPackage rec {
   pname = "flow-record";
-  version = "3.12";
+  version = "3.13";
   format = "pyproject";
 
   disabled = pythonOlder "3.8";
@@ -24,7 +24,7 @@ buildPythonPackage rec {
     owner = "fox-it";
     repo = "flow.record";
     rev = "refs/tags/${version}";
-    hash = "sha256-b9MCgs3Imo0DHtPyvQuRgYvsLWe8N2Y9TIWdU1E04L8=";
+    hash = "sha256-Yg42nA0dRjHormpmpbOuZYuvBpNz9XEpf84XI2iJpYY=";
   };
 
   SETUPTOOLS_SCM_PRETEND_VERSION = version;
diff --git a/pkgs/development/python-modules/glances-api/default.nix b/pkgs/development/python-modules/glances-api/default.nix
index b0f54b53dc62..fc8d2edac2be 100644
--- a/pkgs/development/python-modules/glances-api/default.nix
+++ b/pkgs/development/python-modules/glances-api/default.nix
@@ -11,16 +11,16 @@
 
 buildPythonPackage rec {
   pname = "glances-api";
-  version = "0.4.3";
-  format = "pyproject";
+  version = "0.5.0";
+  pyproject = true;
 
-  disabled = pythonOlder "3.8";
+  disabled = pythonOlder "3.9";
 
   src = fetchFromGitHub {
     owner = "home-assistant-ecosystem";
     repo = "python-glances-api";
     rev = "refs/tags/${version}";
-    hash = "sha256-VfiAJuSmzFVgDTThtsTy7/caRmJKZuD5YwHjMspeB0A=";
+    hash = "sha256-DUTZLLWO4xUeUlxHGGVr/MD5uKqRxUf+p0crYsELgzw=";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/development/python-modules/llm/001-disable-install-uninstall-commands.patch b/pkgs/development/python-modules/llm/001-disable-install-uninstall-commands.patch
new file mode 100644
index 000000000000..cef7fba13343
--- /dev/null
+++ b/pkgs/development/python-modules/llm/001-disable-install-uninstall-commands.patch
@@ -0,0 +1,34 @@
+diff --git a/llm/cli.py b/llm/cli.py
+index af37feb..18b078a 100644
+--- a/llm/cli.py
++++ b/llm/cli.py
+@@ -1014,18 +1014,7 @@ def templates_path():
+ )
+ def install(packages, upgrade, editable, force_reinstall, no_cache_dir):
+     """Install packages from PyPI into the same environment as LLM"""
+-    args = ["pip", "install"]
+-    if upgrade:
+-        args += ["--upgrade"]
+-    if editable:
+-        args += ["--editable", editable]
+-    if force_reinstall:
+-        args += ["--force-reinstall"]
+-    if no_cache_dir:
+-        args += ["--no-cache-dir"]
+-    args += list(packages)
+-    sys.argv = args
+-    run_module("pip", run_name="__main__")
++    click.echo("Install command has been disabled for Nix. If you want to install extra llm plugins, use llm.withPlugins([]) expression.")
+ 
+ 
+ @cli.command()
+@@ -1033,8 +1022,7 @@ def install(packages, upgrade, editable, force_reinstall, no_cache_dir):
+ @click.option("-y", "--yes", is_flag=True, help="Don't ask for confirmation")
+ def uninstall(packages, yes):
+     """Uninstall Python packages from the LLM environment"""
+-    sys.argv = ["pip", "uninstall"] + list(packages) + (["-y"] if yes else [])
+-    run_module("pip", run_name="__main__")
++    click.echo("Uninstall command has been disabled for Nix. If you want to uninstall extra llm plugins, just remove them from llm.withPlugins([]) list expression.")
+ 
+ 
+ @cli.command()
diff --git a/pkgs/development/python-modules/llm/default.nix b/pkgs/development/python-modules/llm/default.nix
new file mode 100644
index 000000000000..318f67353308
--- /dev/null
+++ b/pkgs/development/python-modules/llm/default.nix
@@ -0,0 +1,107 @@
+{
+  buildPythonApplication,
+  buildPythonPackage,
+  fetchFromGitHub,
+  lib,
+  makeWrapper,
+  pytestCheckHook,
+  python3,
+  pythonOlder,
+  ruff,
+  setuptools,
+}: let
+  llm = buildPythonPackage rec {
+    pname = "llm";
+    version = "0.12";
+    pyproject = true;
+
+    disabled = pythonOlder "3.8";
+
+    src = fetchFromGitHub {
+      owner = "simonw";
+      repo = pname;
+      rev = "refs/tags/${version}";
+      hash = "sha256-aCqdw2co/cXrBwVY/k/aSLl3C22nlH5LvU2yir1/NnQ=";
+    };
+
+    patches = [
+      ./001-disable-install-uninstall-commands.patch
+    ];
+
+    nativeBuildInputs = [
+      setuptools
+    ];
+
+    propagatedBuildInputs = with python3.pkgs; [
+      click-default-group
+      numpy
+      openai
+      pluggy
+      pydantic
+      python-ulid
+      pyyaml
+      setuptools # for pkg_resources
+      sqlite-migrate
+      sqlite-utils
+    ];
+
+    nativeCheckInputs = with python3.pkgs; [
+      cogapp
+      numpy
+      pytestCheckHook
+      requests-mock
+    ];
+
+    doCheck = true;
+
+    pytestFlagsArray = [
+      "-svv"
+      "tests/"
+    ];
+
+    pythonImportsCheck = [
+      "llm"
+    ];
+
+    passthru = {inherit withPlugins;};
+
+    meta = with lib; {
+      homepage = "https://github.com/simonw/llm";
+      description = "Access large language models from the command-line";
+      changelog = "https://github.com/simonw/llm/releases/tag/${version}";
+      license = licenses.asl20;
+      mainProgram = "llm";
+      maintainers = with maintainers; [aldoborrero];
+    };
+  };
+
+  withPlugins = plugins: buildPythonApplication {
+    inherit (llm) pname version;
+    format = "other";
+
+    disabled = pythonOlder "3.8";
+
+    dontUnpack = true;
+    dontBuild = true;
+    doCheck = false;
+
+    nativeBuildInputs = [
+      makeWrapper
+    ];
+
+    installPhase = ''
+      makeWrapper ${llm}/bin/llm $out/bin/llm \
+        --prefix PYTHONPATH : "${llm}/${python3.sitePackages}:$PYTHONPATH"
+      ln -sfv ${llm}/lib $out/lib
+    '';
+
+    propagatedBuildInputs = llm.propagatedBuildInputs ++ plugins;
+
+    passthru = llm.passthru // {
+      withPlugins = morePlugins: withPlugins (morePlugins ++ plugins);
+    };
+
+    inherit (llm) meta;
+  };
+in
+  llm
diff --git a/pkgs/development/python-modules/owslib/default.nix b/pkgs/development/python-modules/owslib/default.nix
index 26c62b70c0aa..5e5e5a07b9c5 100644
--- a/pkgs/development/python-modules/owslib/default.nix
+++ b/pkgs/development/python-modules/owslib/default.nix
@@ -15,7 +15,7 @@
 
 buildPythonPackage rec {
   pname = "owslib";
-  version = "0.29.2";
+  version = "0.29.3";
   format = "setuptools";
 
   disabled = pythonOlder "3.7";
@@ -24,7 +24,7 @@ buildPythonPackage rec {
     owner = "geopython";
     repo = "OWSLib";
     rev = "refs/tags/${version}";
-    hash = "sha256-dbL4VdnPszwiDO+UjluuyqeBRMKojTnZPEFKEYiIWS0=";
+    hash = "sha256-yAJXknSsGXcerzaOVSrFO4j5E6B/4/0JfoSxZ+Szmws=";
   };
 
   postPatch = ''
@@ -72,7 +72,7 @@ buildPythonPackage rec {
   meta = with lib; {
     description = "Client for Open Geospatial Consortium web service interface standards";
     homepage = "https://www.osgeo.org/projects/owslib/";
-    changelog = "https://github.com/geopython/OWSLib/blob/${version}/CHANGES.rst";
+    changelog = "https://github.com/geopython/OWSLib/releases/tag/${version}";
     license = licenses.bsd3;
     maintainers = teams.geospatial.members;
   };
diff --git a/pkgs/development/python-modules/pyudev/default.nix b/pkgs/development/python-modules/pyudev/default.nix
index 29b1e5f8d530..8c3c0d86f3b8 100644
--- a/pkgs/development/python-modules/pyudev/default.nix
+++ b/pkgs/development/python-modules/pyudev/default.nix
@@ -1,5 +1,13 @@
-{ lib, fetchPypi, buildPythonPackage
-, six, udev, pytest, mock, hypothesis, docutils
+{ lib
+, fetchPypi
+, buildPythonPackage
+, six
+, udev
+, pytest
+, mock
+, hypothesis
+, docutils
+, stdenvNoCC
 }:
 
 buildPythonPackage rec {
@@ -11,7 +19,7 @@ buildPythonPackage rec {
     hash = "sha256-deVNNyGPWsRbDaHw/ZzF5SajysPvHPrUEM96sziwFHE=";
   };
 
-  postPatch = ''
+  postPatch = lib.optionalString stdenvNoCC.isLinux ''
     substituteInPlace src/pyudev/_ctypeslib/utils.py \
       --replace "find_library(name)" "'${lib.getLib udev}/lib/libudev.so'"
     '';
@@ -27,9 +35,10 @@ buildPythonPackage rec {
   # https://github.com/pyudev/pyudev/issues/187
   doCheck = false;
 
-  meta = {
+  meta = with lib; {
     homepage = "https://pyudev.readthedocs.org/";
     description = "Pure Python libudev binding";
-    license = lib.licenses.lgpl21Plus;
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ frogamic ];
   };
 }
diff --git a/pkgs/development/python-modules/sqids/default.nix b/pkgs/development/python-modules/sqids/default.nix
index dc6befc17991..a9d5fe372953 100644
--- a/pkgs/development/python-modules/sqids/default.nix
+++ b/pkgs/development/python-modules/sqids/default.nix
@@ -8,14 +8,14 @@
 
 buildPythonPackage rec {
   pname = "sqids";
-  version = "0.4.0";
+  version = "0.4.1";
   pyproject = true;
 
   disabled = pythonOlder "3.8";
 
   src = fetchPypi {
     inherit pname version;
-    hash = "sha256-U9nVpRc9PIM1ZO+bcL3RGIfAdlUMf+uFw/SpPTAjdnA=";
+    hash = "sha256-/8P7/vY0kb7ouUCpgGU4g0Xb77BtSeQVt6nkdcogD50=";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/development/web/mailcatcher/default.nix b/pkgs/development/web/mailcatcher/default.nix
index df6ed0a5233a..17d25378d8cd 100644
--- a/pkgs/development/web/mailcatcher/default.nix
+++ b/pkgs/development/web/mailcatcher/default.nix
@@ -1,10 +1,10 @@
-{ pkgs, lib, bundlerApp, bundlerUpdateScript }:
+{ ruby_3_2, lib, bundlerApp, bundlerUpdateScript }:
 
 bundlerApp {
   pname = "mailcatcher";
   gemdir = ./.;
   exes = [ "mailcatcher" "catchmail" ];
-  ruby = pkgs.ruby_3_0;
+  ruby = ruby_3_2;
 
   passthru.updateScript = bundlerUpdateScript "mailcatcher";
 
diff --git a/pkgs/os-specific/darwin/skhd/default.nix b/pkgs/os-specific/darwin/skhd/default.nix
index fa6e1aa01e9f..f979f7ec020e 100644
--- a/pkgs/os-specific/darwin/skhd/default.nix
+++ b/pkgs/os-specific/darwin/skhd/default.nix
@@ -26,6 +26,8 @@ stdenv.mkDerivation (finalAttrs: {
     "BUILD_PATH=$(out)/bin"
   ];
 
+  env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
+
   postInstall = ''
     mkdir -p $out/Library/LaunchDaemons
     cp ${./org.nixos.skhd.plist} $out/Library/LaunchDaemons/org.nixos.skhd.plist
diff --git a/pkgs/servers/dendrite/default.nix b/pkgs/servers/dendrite/default.nix
index d722f6beb0ab..4dfe4b33318c 100644
--- a/pkgs/servers/dendrite/default.nix
+++ b/pkgs/servers/dendrite/default.nix
@@ -1,5 +1,12 @@
-{ lib, buildGoModule, fetchFromGitHub, nix-update-script
-, nixosTests, postgresql, postgresqlTestHook }:
+{ lib
+, stdenv
+, buildGoModule
+, fetchFromGitHub
+, nix-update-script
+, nixosTests
+, postgresql
+, postgresqlTestHook
+}:
 
 buildGoModule rec {
   pname = "matrix-dendrite";
@@ -44,6 +51,9 @@ buildGoModule rec {
     rm roomserver/internal/input/input_test.go
   '';
 
+  # PostgreSQL's request for a shared memory segment exceeded your kernel's SHMALL parameter
+  doCheck = !(stdenv.isDarwin && stdenv.isx86_64);
+
   passthru.tests = {
     inherit (nixosTests) dendrite;
   };
diff --git a/pkgs/servers/http/unit/default.nix b/pkgs/servers/http/unit/default.nix
index 5d1da4c47060..6f75352796cd 100644
--- a/pkgs/servers/http/unit/default.nix
+++ b/pkgs/servers/http/unit/default.nix
@@ -5,7 +5,6 @@
 , withPHP82 ? false, php82
 , withPerl536 ? false, perl536
 , withPerl538 ? true, perl538
-, withRuby_3_0 ? false, ruby_3_0
 , withRuby_3_1 ? true, ruby_3_1
 , withRuby_3_2 ? false, ruby_3_2
 , withSSL ? true, openssl ? null
@@ -47,7 +46,6 @@ in stdenv.mkDerivation rec {
     ++ optional withPHP82 php82-unit
     ++ optional withPerl536 perl536
     ++ optional withPerl538 perl538
-    ++ optional withRuby_3_0 ruby_3_0
     ++ optional withRuby_3_1 ruby_3_1
     ++ optional withRuby_3_2 ruby_3_2
     ++ optional withSSL openssl;
@@ -70,7 +68,6 @@ in stdenv.mkDerivation rec {
     ${optionalString withPHP82      "./configure php    --module=php81    --config=${php82-unit.unwrapped.dev}/bin/php-config --lib-path=${php82-unit}/lib"}
     ${optionalString withPerl536    "./configure perl   --module=perl536  --perl=${perl536}/bin/perl"}
     ${optionalString withPerl538    "./configure perl   --module=perl538  --perl=${perl538}/bin/perl"}
-    ${optionalString withRuby_3_0   "./configure ruby   --module=ruby30   --ruby=${ruby_3_0}/bin/ruby"}
     ${optionalString withRuby_3_1   "./configure ruby   --module=ruby31   --ruby=${ruby_3_1}/bin/ruby"}
     ${optionalString withRuby_3_2   "./configure ruby   --module=ruby32   --ruby=${ruby_3_2}/bin/ruby"}
   '';
diff --git a/pkgs/servers/jitsi-excalidraw/default.nix b/pkgs/servers/jitsi-excalidraw/default.nix
new file mode 100644
index 000000000000..bb8bb6c2dfa7
--- /dev/null
+++ b/pkgs/servers/jitsi-excalidraw/default.nix
@@ -0,0 +1,40 @@
+{ lib
+, buildNpmPackage
+, fetchFromGitHub
+, nodejs
+, python3
+}:
+
+buildNpmPackage rec {
+  pname = "jitsi-excalidraw-backend";
+  version = "17";
+
+  src = fetchFromGitHub {
+    owner = "jitsi";
+    repo = "excalidraw-backend";
+    rev = "x${version}";
+    hash = "sha256-aQePkVA8KRL06VewiD0ePRpj88pAItcV7B2SBnRRtCs=";
+  };
+
+  npmDepsHash = "sha256-BJqjaqTeg5i+ECGMuiBYVToK2i2XCOVP9yeDFz6nP4k=";
+
+  nativeBuildInputs = [ python3 ];
+
+  installPhase = ''
+    mkdir -p $out/share
+    cp -r {node_modules,dist} $out/share
+  '';
+
+  postFixup = ''
+    makeWrapper ${nodejs}/bin/node $out/bin/jitsi-excalidraw-backend \
+      --add-flags dist/index.js \
+      --chdir $out/share
+  '';
+
+  meta = with lib; {
+    description = "Excalidraw collaboration backend for Jitsi";
+    homepage = "https://github.com/jitsi/excalidraw-backend";
+    license = licenses.mit;
+    maintainers = with maintainers; [ camillemndn ];
+  };
+}
diff --git a/pkgs/servers/matrix-synapse/default.nix b/pkgs/servers/matrix-synapse/default.nix
index 4b7c6d21f30d..ef8ff520c072 100644
--- a/pkgs/servers/matrix-synapse/default.nix
+++ b/pkgs/servers/matrix-synapse/default.nix
@@ -3,6 +3,7 @@
 , fetchFromGitHub
 , python3
 , openssl
+, libiconv
 , cargo
 , rustPlatform
 , rustc
@@ -57,6 +58,8 @@ python3.pkgs.buildPythonApplication rec {
 
   buildInputs = [
     openssl
+  ] ++ lib.optionals stdenv.isDarwin [
+    libiconv
   ];
 
   propagatedBuildInputs = with python3.pkgs; [
diff --git a/pkgs/servers/nextcloud/packages/26.json b/pkgs/servers/nextcloud/packages/26.json
index 10146a318324..82d03843ad9a 100644
--- a/pkgs/servers/nextcloud/packages/26.json
+++ b/pkgs/servers/nextcloud/packages/26.json
@@ -10,9 +10,9 @@
     ]
   },
   "calendar": {
-    "sha256": "1827l5hxsvfnyc2m78rs95cnb2fwi14nl7ricpl25ndh1j0a7ccz",
-    "url": "https://github.com/nextcloud-releases/calendar/releases/download/v4.5.2/calendar-v4.5.2.tar.gz",
-    "version": "4.5.2",
+    "sha256": "1iq8np72pjw2bn4zmbp2rmrh12n4z62rwrz2bb94xjza1fws7b2v",
+    "url": "https://github.com/nextcloud-releases/calendar/releases/download/v4.5.3/calendar-v4.5.3.tar.gz",
+    "version": "4.5.3",
     "description": "The Calendar app is a user interface for Nextcloud's CalDAV server. Easily sync events from various devices with your Nextcloud and edit them online.\n\n* πŸš€ **Integration with other Nextcloud apps!** Currently Contacts - more to come.\n* 🌐 **WebCal Support!** Want to see your favorite team’s matchdays in your calendar? No problem!\n* πŸ™‹ **Attendees!** Invite people to your events\n* ⌚️ **Free/Busy!** See when your attendees are available to meet\n* ⏰ **Reminders!** Get alarms for events inside your browser and via email\n* πŸ” Search! Find your events at ease\n* β˜‘οΈ Tasks! See tasks with a due date directly in the calendar\n* πŸ™ˆ **We’re not reinventing the wheel!** Based on the great [c-dav library](https://github.com/nextcloud/cdav-library), [ical.js](https://github.com/mozilla-comm/ical.js) and [fullcalendar](https://github.com/fullcalendar/fullcalendar) libraries.",
     "homepage": "https://github.com/nextcloud/calendar/",
     "licenses": [
@@ -29,6 +29,16 @@
       "agpl"
     ]
   },
+  "cookbook": {
+    "sha256": "18rzvdqd99nlkk3p0y9y8b17ihw5c4c9wsx8psq6xadspm97002y",
+    "url": "https://github.com/nextcloud/cookbook/releases/download/v0.10.2/Cookbook-0.10.2.tar.gz",
+    "version": "0.10.2",
+    "description": "A library for all your recipes. It uses JSON files following the schema.org recipe format. To add a recipe to the collection, you can paste in the URL of the recipe, and the provided web page will be parsed and downloaded to whichever folder you specify in the app settings.",
+    "homepage": "",
+    "licenses": [
+      "agpl"
+    ]
+  },
   "cospend": {
     "sha256": "1rg9k33yapbl8chpxx3bjyzc9h4krjavksbxsvw14kpm01rss3j9",
     "url": "https://github.com/julien-nc/cospend-nc/releases/download/v1.5.10/cospend-1.5.10.tar.gz",
@@ -40,9 +50,9 @@
     ]
   },
   "deck": {
-    "sha256": "0j228lbf0zrm2sq45f9abgkln1qzgrkw8ac5r6fhyi0qfxcpmm0m",
-    "url": "https://github.com/nextcloud-releases/deck/releases/download/v1.9.3/deck-v1.9.3.tar.gz",
-    "version": "1.9.3",
+    "sha256": "15hir3fssvzyysazbaad8qiz0bv00x73c2wfdj5aviz9h0gp4x4v",
+    "url": "https://github.com/nextcloud-releases/deck/releases/download/v1.9.4/deck-v1.9.4.tar.gz",
+    "version": "1.9.4",
     "description": "Deck is a kanban style organization tool aimed at personal planning and project organization for teams integrated with Nextcloud.\n\n\n- πŸ“₯ Add your tasks to cards and put them in order\n- πŸ“„ Write down additional notes in Markdown\n- πŸ”– Assign labels for even better organization\n- πŸ‘₯ Share with your team, friends or family\n- πŸ“Ž Attach files and embed them in your Markdown description\n- πŸ’¬ Discuss with your team using comments\n- ⚑ Keep track of changes in the activity stream\n- πŸš€ Get your project organized",
     "homepage": "https://github.com/nextcloud/deck",
     "licenses": [
@@ -93,7 +103,7 @@
     "sha256": "0imddmyg9s1v3d20spr26g7mbyz2mwl3v2l1a4nz5kaxl3a6fsr2",
     "url": "https://github.com/nextcloud-releases/impersonate/releases/download/v1.13.1/impersonate-v1.13.1.tar.gz",
     "version": "1.13.1",
-    "description": "By installing the impersonate app of your Nextcloud you enable administrators to impersonate other users on the Nextcloud server. This is especially useful for debugging issues reported by users.\n\nTo impersonate a user an administrator has to simply follow the following four steps:\n\n1. Login as administrator to Nextcloud.\n2. Open users administration interface.\n3. Select the impersonate button on the affected user.\n4. Confirm the impersonation.\n\nThe administrator is then logged-in as the user, to switch back to the regular user account they simply have to press the logout button.\n\n**Note:**\n\n- This app is not compatible with instances that have encryption enabled.\n- While impersonate actions are logged note that actions performed impersonated will be logged as the impersonated user.\n- Impersonating a user is only possible after their first login.",
+    "description": "By installing the impersonate app of your Nextcloud you enable administrators to impersonate other users on the Nextcloud server. This is especially useful for debugging issues reported by users.\n\nTo impersonate a user an administrator has to simply follow the following four steps:\n\n1. Login as administrator to Nextcloud.\n2. Open users administration interface.\n3. Select the impersonate button on the affected user.\n4. Confirm the impersonation.\n\nThe administrator is then logged-in as the user, to switch back to the regular user account they simply have to press the logout button.\n\n**Note:**\n\n- This app is not compatible with instances that have encryption enabled.\n- While impersonate actions are logged note that actions performed impersonated will be logged as the impersonated user.\n- Impersonating a user is only possible after their first login.\n- You can limit which users/groups can use impersonation in Administration settings > Additional settings.",
     "homepage": "https://github.com/nextcloud/impersonate",
     "licenses": [
       "agpl"
@@ -110,10 +120,10 @@
     ]
   },
   "mail": {
-    "sha256": "0mr3npd48j444lalkph1z8rsz5jllpgdrcqsjdrqgmf70y0g55mh",
-    "url": "https://github.com/nextcloud-releases/mail/releases/download/v3.4.3/mail-v3.4.3.tar.gz",
-    "version": "3.4.3",
-    "description": "**πŸ’Œ A mail app for Nextcloud**\n\n- **πŸš€ Integration with other Nextcloud apps!** Currently Contacts, Calendar & Files – more to come.\n- **πŸ“₯ Multiple mail accounts!** Personal and company account? No problem, and a nice unified inbox. Connect any IMAP account.\n- **πŸ”’ Send & receive encrypted mails!** Using the great [Mailvelope](https://mailvelope.com) browser extension.\n- **πŸ™ˆ We’re not reinventing the wheel!** Based on the great [Horde](https://horde.org) libraries.\n- **πŸ“¬ Want to host your own mail server?** We do not have to reimplement this as you could set up [Mail-in-a-Box](https://mailinabox.email)!",
+    "sha256": "0ascail3vfkv3mm5s4s3ma74d6qxai76kdqxknmljnw56xb19qfv",
+    "url": "https://github.com/nextcloud-releases/mail/releases/download/v3.4.4/mail-v3.4.4.tar.gz",
+    "version": "3.4.4",
+    "description": "**πŸ’Œ A mail app for Nextcloud**\n\n- **πŸš€ Integration with other Nextcloud apps!** Currently Contacts, Calendar & Files – more to come.\n- **πŸ“₯ Multiple mail accounts!** Personal and company account? No problem, and a nice unified inbox. Connect any IMAP account.\n- **πŸ”’ Send & receive encrypted mails!** Using the great [Mailvelope](https://mailvelope.com) browser extension.\n- **πŸ™ˆ We’re not reinventing the wheel!** Based on the great [Horde](https://horde.org) libraries.\n- **πŸ“¬ Want to host your own mail server?** We do not have to reimplement this as you could set up [Mail-in-a-Box](https://mailinabox.email)!\n\n## Ethical AI Rating\n\n### Priority Inbox\n\nPositive:\n* The software for training and inferencing of this model is open source.\n* The model is created and trained on-premises based on the user's own data.\n* The training data is accessible to the user, making it possible to check or correct for bias or optimise the performance and CO2 usage.\n\n### Thread Summaries (opt-in)\n\n**Rating:** 🟒/🟑/🟠/πŸ”΄\n\nThe rating depends on the installed text processing backend. See [the rating overview](https://docs.nextcloud.com/server/latest/admin_manual/ai/index.html) for details.\n\nLearn more about the Nextcloud Ethical AI Rating [in our blog](https://nextcloud.com/blog/nextcloud-ethical-ai-rating/).",
     "homepage": "https://github.com/nextcloud/mail#readme",
     "licenses": [
       "agpl"
@@ -130,15 +140,25 @@
     ]
   },
   "memories": {
-    "sha256": "0i146mlg27phs407clclksn1wjkyl0c5fb2zw0npbx5dvqnpglcd",
-    "url": "https://github.com/pulsejet/memories/releases/download/v6.0.1/memories.tar.gz",
-    "version": "6.0.1",
+    "sha256": "1yn1wkv4jxpc8faf4rl46yfddyplnryrkws3jz0x1wcr9zlxdkng",
+    "url": "https://github.com/pulsejet/memories/releases/download/v6.1.0/memories.tar.gz",
+    "version": "6.1.0",
     "description": "# Memories: Photo Management for Nextcloud\n\nMemories is a *batteries-included* photo management solution for Nextcloud with advanced features including:\n\n- **πŸ“Έ Timeline**: Sort photos and videos by date taken, parsed from Exif data.\n- **βͺ Rewind**: Jump to any time in the past instantly and relive your memories.\n- **πŸ€– AI Tagging**: Group photos by people and objects, powered by [recognize](https://github.com/nextcloud/recognize) and [facerecognition](https://github.com/matiasdelellis/facerecognition).\n- **πŸ–ΌοΈ Albums**: Create albums to group photos and videos together. Then share these albums with others.\n- **πŸ«±πŸ»β€πŸ«²πŸ» External Sharing**: Share photos and videos with people outside of your Nextcloud instance.\n- **πŸ“± Mobile Support**: Work from any device, of any shape and size through the web app.\n- **✏️ Edit Metadata**: Edit dates and other metadata on photos quickly and in bulk.\n- **πŸ“¦ Archive**: Store photos you don't want to see in your timeline in a separate folder.\n- **πŸ“Ή Video Transcoding**: Transcode videos and use HLS for maximal performance.\n- **πŸ—ΊοΈ Map**: View your photos on a map, tagged with accurate reverse geocoding.\n- **πŸ“¦ Migration**: Migrate easily from Nextcloud Photos and Google Takeout.\n- **⚑️ Performance**: Do all this very fast.\n\n## πŸš€ Installation\n\n1. Install the app from the Nextcloud app store (try a demo [here](https://demo.memories.gallery/apps/memories/)).\n1. Perform the recommended [configuration steps](https://memories.gallery/config/).\n1. Run `php occ memories:index` to generate metadata indices for existing photos.\n1. Open the πŸ“· Memories app in Nextcloud and set the directory containing your photos.",
     "homepage": "https://memories.gallery",
     "licenses": [
       "agpl"
     ]
   },
+  "music": {
+    "sha256": "06w82v34csx4scl5n4k4fpdxiivrzjb3yvj3hh4bc15gdz68cis9",
+    "url": "https://github.com/owncloud/music/releases/download/v1.9.1/music_1.9.1_for_nextcloud.tar.gz",
+    "version": "1.9.1",
+    "description": "A stand-alone music player app and a \"lite\" player for the Files app\n\n- On modern browsers, supports audio types .mp3, .ogg, .m4a, .m4b, .flac, .wav, and more\n- Playlist support with import from m3u, m3u8, and pls files\n- Browse by artists, albums, genres, or folders\n- Gapless play\n- Filter the shown content with the search function\n- Play internet radio and podcast channels\n- Setup Last.fm connection to see background information on artists, albums, and songs\n- Control with media control keys on the keyboard or OS\n- The app can handle libraries consisting of thousands of albums and tens of thousands of songs\n- Includes a server backend compatible with the Subsonic and Ampache protocols, allowing playback and browsing of your library on various external apps e.g. on Android or iPhone",
+    "homepage": "https://github.com/owncloud/music",
+    "licenses": [
+      "agpl"
+    ]
+  },
   "news": {
     "sha256": "1bkh73h0ibxyjpy3cmvhnlr7isvgqkcxdw2dw15mxksj2cln9wki",
     "url": "https://github.com/nextcloud/news/releases/download/24.0.0/news.tar.gz",
@@ -160,9 +180,9 @@
     ]
   },
   "notify_push": {
-    "sha256": "0hdxnkar2ibis5p0gp3yr1i6894la9wxq4pzrbqdrq2cgvsj6a18",
-    "url": "https://github.com/nextcloud-releases/notify_push/releases/download/v0.6.3/notify_push-v0.6.3.tar.gz",
-    "version": "0.6.3",
+    "sha256": "0lwyy1pnyfw464vab1v5k8q0rgarrj5w12cf1nsywjaafb8y1ym0",
+    "url": "https://github.com/nextcloud-releases/notify_push/releases/download/v0.6.5/notify_push-v0.6.5.tar.gz",
+    "version": "0.6.5",
     "description": "Push update support for desktop app.\n\nOnce the app is installed, the push binary needs to be setup. You can either use the setup wizard with `occ notify_push:setup` or see the [README](http://github.com/nextcloud/notify_push) for detailed setup instructions",
     "homepage": "",
     "licenses": [
@@ -180,9 +200,9 @@
     ]
   },
   "polls": {
-    "sha256": "1v5zb164f60qskfiv02l9x2v0d4rayacg5qivd70dawmyqnz4vmd",
-    "url": "https://github.com/nextcloud/polls/releases/download/v5.3.2/polls.tar.gz",
-    "version": "5.3.2",
+    "sha256": "1dmws4ybv3pzxz5g9c7ghblx0nfal2ssmsg7hjcs1n4xcjc6585p",
+    "url": "https://github.com/nextcloud/polls/releases/download/v5.4.2/polls.tar.gz",
+    "version": "5.4.2",
     "description": "A polls app, similar to Doodle/Dudle with the possibility to restrict access (members, certain groups/users, hidden and public).",
     "homepage": "https://github.com/nextcloud/polls",
     "licenses": [
@@ -240,9 +260,9 @@
     ]
   },
   "twofactor_nextcloud_notification": {
-    "sha256": "03fp8wcwhyp8ivrcf20klgg17sxc9fia5sa44rbrv3cicmwmw50b",
-    "url": "https://github.com/nextcloud-releases/twofactor_nextcloud_notification/releases/download/v3.7.0/twofactor_nextcloud_notification-v3.7.0.tar.gz",
-    "version": "3.7.0",
+    "sha256": "0gaqgzbryim580dxarak7p4g3wd8wp3w6lw9jhl84jh46wrsbrj8",
+    "url": "https://github.com/nextcloud-releases/twofactor_nextcloud_notification/releases/download/v3.8.0/twofactor_nextcloud_notification-v3.8.0.tar.gz",
+    "version": "3.8.0",
     "description": "Allows using any of your logged in devices as second factor",
     "homepage": "https://github.com/nextcloud/twofactor_nextcloud_notification",
     "licenses": [
@@ -250,9 +270,9 @@
     ]
   },
   "twofactor_webauthn": {
-    "sha256": "1lqcw74rsnl8c4sirw9208ra3c8zl8zp93scs7y8fv2n4n60l465",
-    "url": "https://github.com/nextcloud-releases/twofactor_webauthn/releases/download/v1.2.0/twofactor_webauthn-v1.2.0.tar.gz",
-    "version": "1.2.0",
+    "sha256": "0z6m2chq5kxc8f10g6n1lh51yi10svy2qp5gp0v8xs71apqcc2wx",
+    "url": "https://github.com/nextcloud-releases/twofactor_webauthn/releases/download/v1.3.0/twofactor_webauthn-v1.3.0.tar.gz",
+    "version": "1.3.0",
     "description": "A two-factor provider for WebAuthn devices",
     "homepage": "https://github.com/nextcloud/twofactor_webauthn#readme",
     "licenses": [
@@ -270,9 +290,9 @@
     ]
   },
   "user_saml": {
-    "sha256": "1gsq5mcn5nnxd56jlp4j2610gqq2gk3ma9yvhgy74wl0sqil98jd",
-    "url": "https://github.com/nextcloud-releases/user_saml/releases/download/v5.2.2/user_saml-v5.2.2.tar.gz",
-    "version": "5.2.2",
+    "sha256": "04ivgqdls72p6x5yrh5p5ycbbfmxhzd0dqin1grblm6cbl7b4s2k",
+    "url": "https://github.com/nextcloud-releases/user_saml/releases/download/v5.2.4/user_saml-v5.2.4.tar.gz",
+    "version": "5.2.4",
     "description": "Using the SSO & SAML app of your Nextcloud you can make it easily possible to integrate your existing Single-Sign-On solution with Nextcloud. In addition, you can use the Nextcloud LDAP user provider to keep the convenience for users. (e.g. when sharing)\nThe following providers are supported and tested at the moment:\n\n* **SAML 2.0**\n\t* OneLogin\n\t* Shibboleth\n\t* Active Directory Federation Services (ADFS)\n\n* **Authentication via Environment Variable**\n\t* Kerberos (mod_auth_kerb)\n\t* Any other provider that authenticates using the environment variable\n\nWhile theoretically any other authentication provider implementing either one of those standards is compatible, we like to note that they are not part of any internal test matrix.",
     "homepage": "https://github.com/nextcloud/user_saml",
     "licenses": [
diff --git a/pkgs/servers/nextcloud/packages/27.json b/pkgs/servers/nextcloud/packages/27.json
index 257a773ecb76..6ecb1f3f522b 100644
--- a/pkgs/servers/nextcloud/packages/27.json
+++ b/pkgs/servers/nextcloud/packages/27.json
@@ -10,9 +10,9 @@
     ]
   },
   "calendar": {
-    "sha256": "1827l5hxsvfnyc2m78rs95cnb2fwi14nl7ricpl25ndh1j0a7ccz",
-    "url": "https://github.com/nextcloud-releases/calendar/releases/download/v4.5.2/calendar-v4.5.2.tar.gz",
-    "version": "4.5.2",
+    "sha256": "1iq8np72pjw2bn4zmbp2rmrh12n4z62rwrz2bb94xjza1fws7b2v",
+    "url": "https://github.com/nextcloud-releases/calendar/releases/download/v4.5.3/calendar-v4.5.3.tar.gz",
+    "version": "4.5.3",
     "description": "The Calendar app is a user interface for Nextcloud's CalDAV server. Easily sync events from various devices with your Nextcloud and edit them online.\n\n* πŸš€ **Integration with other Nextcloud apps!** Currently Contacts - more to come.\n* 🌐 **WebCal Support!** Want to see your favorite team’s matchdays in your calendar? No problem!\n* πŸ™‹ **Attendees!** Invite people to your events\n* ⌚️ **Free/Busy!** See when your attendees are available to meet\n* ⏰ **Reminders!** Get alarms for events inside your browser and via email\n* πŸ” Search! Find your events at ease\n* β˜‘οΈ Tasks! See tasks with a due date directly in the calendar\n* πŸ™ˆ **We’re not reinventing the wheel!** Based on the great [c-dav library](https://github.com/nextcloud/cdav-library), [ical.js](https://github.com/mozilla-comm/ical.js) and [fullcalendar](https://github.com/fullcalendar/fullcalendar) libraries.",
     "homepage": "https://github.com/nextcloud/calendar/",
     "licenses": [
@@ -29,6 +29,16 @@
       "agpl"
     ]
   },
+  "cookbook": {
+    "sha256": "18rzvdqd99nlkk3p0y9y8b17ihw5c4c9wsx8psq6xadspm97002y",
+    "url": "https://github.com/nextcloud/cookbook/releases/download/v0.10.2/Cookbook-0.10.2.tar.gz",
+    "version": "0.10.2",
+    "description": "A library for all your recipes. It uses JSON files following the schema.org recipe format. To add a recipe to the collection, you can paste in the URL of the recipe, and the provided web page will be parsed and downloaded to whichever folder you specify in the app settings.",
+    "homepage": "",
+    "licenses": [
+      "agpl"
+    ]
+  },
   "cospend": {
     "sha256": "1rg9k33yapbl8chpxx3bjyzc9h4krjavksbxsvw14kpm01rss3j9",
     "url": "https://github.com/julien-nc/cospend-nc/releases/download/v1.5.10/cospend-1.5.10.tar.gz",
@@ -40,9 +50,9 @@
     ]
   },
   "deck": {
-    "sha256": "060im5zlj7w6x9d5jpxsziqc8ym6fk573dynvdz231jx360s52g6",
-    "url": "https://github.com/nextcloud-releases/deck/releases/download/v1.11.0/deck-v1.11.0.tar.gz",
-    "version": "1.11.0",
+    "sha256": "18gscc95zay7nrzdm1h5b52r4bpmpzc1h1xb00214qnb59mydiwr",
+    "url": "https://github.com/nextcloud-releases/deck/releases/download/v1.11.1/deck-v1.11.1.tar.gz",
+    "version": "1.11.1",
     "description": "Deck is a kanban style organization tool aimed at personal planning and project organization for teams integrated with Nextcloud.\n\n\n- πŸ“₯ Add your tasks to cards and put them in order\n- πŸ“„ Write down additional notes in Markdown\n- πŸ”– Assign labels for even better organization\n- πŸ‘₯ Share with your team, friends or family\n- πŸ“Ž Attach files and embed them in your Markdown description\n- πŸ’¬ Discuss with your team using comments\n- ⚑ Keep track of changes in the activity stream\n- πŸš€ Get your project organized",
     "homepage": "https://github.com/nextcloud/deck",
     "licenses": [
@@ -93,7 +103,7 @@
     "sha256": "1rpqi7yqzhmdqfl2hq326zv91gn246bgqjzcimsiap20f22z169j",
     "url": "https://github.com/nextcloud-releases/impersonate/releases/download/v1.14.0/impersonate-v1.14.0.tar.gz",
     "version": "1.14.0",
-    "description": "By installing the impersonate app of your Nextcloud you enable administrators to impersonate other users on the Nextcloud server. This is especially useful for debugging issues reported by users.\n\nTo impersonate a user an administrator has to simply follow the following four steps:\n\n1. Login as administrator to Nextcloud.\n2. Open users administration interface.\n3. Select the impersonate button on the affected user.\n4. Confirm the impersonation.\n\nThe administrator is then logged-in as the user, to switch back to the regular user account they simply have to press the logout button.\n\n**Note:**\n\n- This app is not compatible with instances that have encryption enabled.\n- While impersonate actions are logged note that actions performed impersonated will be logged as the impersonated user.\n- Impersonating a user is only possible after their first login.",
+    "description": "By installing the impersonate app of your Nextcloud you enable administrators to impersonate other users on the Nextcloud server. This is especially useful for debugging issues reported by users.\n\nTo impersonate a user an administrator has to simply follow the following four steps:\n\n1. Login as administrator to Nextcloud.\n2. Open users administration interface.\n3. Select the impersonate button on the affected user.\n4. Confirm the impersonation.\n\nThe administrator is then logged-in as the user, to switch back to the regular user account they simply have to press the logout button.\n\n**Note:**\n\n- This app is not compatible with instances that have encryption enabled.\n- While impersonate actions are logged note that actions performed impersonated will be logged as the impersonated user.\n- Impersonating a user is only possible after their first login.\n- You can limit which users/groups can use impersonation in Administration settings > Additional settings.",
     "homepage": "https://github.com/nextcloud/impersonate",
     "licenses": [
       "agpl"
@@ -110,10 +120,10 @@
     ]
   },
   "mail": {
-    "sha256": "0mr3npd48j444lalkph1z8rsz5jllpgdrcqsjdrqgmf70y0g55mh",
-    "url": "https://github.com/nextcloud-releases/mail/releases/download/v3.4.3/mail-v3.4.3.tar.gz",
-    "version": "3.4.3",
-    "description": "**πŸ’Œ A mail app for Nextcloud**\n\n- **πŸš€ Integration with other Nextcloud apps!** Currently Contacts, Calendar & Files – more to come.\n- **πŸ“₯ Multiple mail accounts!** Personal and company account? No problem, and a nice unified inbox. Connect any IMAP account.\n- **πŸ”’ Send & receive encrypted mails!** Using the great [Mailvelope](https://mailvelope.com) browser extension.\n- **πŸ™ˆ We’re not reinventing the wheel!** Based on the great [Horde](https://horde.org) libraries.\n- **πŸ“¬ Want to host your own mail server?** We do not have to reimplement this as you could set up [Mail-in-a-Box](https://mailinabox.email)!",
+    "sha256": "0ascail3vfkv3mm5s4s3ma74d6qxai76kdqxknmljnw56xb19qfv",
+    "url": "https://github.com/nextcloud-releases/mail/releases/download/v3.4.4/mail-v3.4.4.tar.gz",
+    "version": "3.4.4",
+    "description": "**πŸ’Œ A mail app for Nextcloud**\n\n- **πŸš€ Integration with other Nextcloud apps!** Currently Contacts, Calendar & Files – more to come.\n- **πŸ“₯ Multiple mail accounts!** Personal and company account? No problem, and a nice unified inbox. Connect any IMAP account.\n- **πŸ”’ Send & receive encrypted mails!** Using the great [Mailvelope](https://mailvelope.com) browser extension.\n- **πŸ™ˆ We’re not reinventing the wheel!** Based on the great [Horde](https://horde.org) libraries.\n- **πŸ“¬ Want to host your own mail server?** We do not have to reimplement this as you could set up [Mail-in-a-Box](https://mailinabox.email)!\n\n## Ethical AI Rating\n\n### Priority Inbox\n\nPositive:\n* The software for training and inferencing of this model is open source.\n* The model is created and trained on-premises based on the user's own data.\n* The training data is accessible to the user, making it possible to check or correct for bias or optimise the performance and CO2 usage.\n\n### Thread Summaries (opt-in)\n\n**Rating:** 🟒/🟑/🟠/πŸ”΄\n\nThe rating depends on the installed text processing backend. See [the rating overview](https://docs.nextcloud.com/server/latest/admin_manual/ai/index.html) for details.\n\nLearn more about the Nextcloud Ethical AI Rating [in our blog](https://nextcloud.com/blog/nextcloud-ethical-ai-rating/).",
     "homepage": "https://github.com/nextcloud/mail#readme",
     "licenses": [
       "agpl"
@@ -130,15 +140,25 @@
     ]
   },
   "memories": {
-    "sha256": "0i146mlg27phs407clclksn1wjkyl0c5fb2zw0npbx5dvqnpglcd",
-    "url": "https://github.com/pulsejet/memories/releases/download/v6.0.1/memories.tar.gz",
-    "version": "6.0.1",
+    "sha256": "1yn1wkv4jxpc8faf4rl46yfddyplnryrkws3jz0x1wcr9zlxdkng",
+    "url": "https://github.com/pulsejet/memories/releases/download/v6.1.0/memories.tar.gz",
+    "version": "6.1.0",
     "description": "# Memories: Photo Management for Nextcloud\n\nMemories is a *batteries-included* photo management solution for Nextcloud with advanced features including:\n\n- **πŸ“Έ Timeline**: Sort photos and videos by date taken, parsed from Exif data.\n- **βͺ Rewind**: Jump to any time in the past instantly and relive your memories.\n- **πŸ€– AI Tagging**: Group photos by people and objects, powered by [recognize](https://github.com/nextcloud/recognize) and [facerecognition](https://github.com/matiasdelellis/facerecognition).\n- **πŸ–ΌοΈ Albums**: Create albums to group photos and videos together. Then share these albums with others.\n- **πŸ«±πŸ»β€πŸ«²πŸ» External Sharing**: Share photos and videos with people outside of your Nextcloud instance.\n- **πŸ“± Mobile Support**: Work from any device, of any shape and size through the web app.\n- **✏️ Edit Metadata**: Edit dates and other metadata on photos quickly and in bulk.\n- **πŸ“¦ Archive**: Store photos you don't want to see in your timeline in a separate folder.\n- **πŸ“Ή Video Transcoding**: Transcode videos and use HLS for maximal performance.\n- **πŸ—ΊοΈ Map**: View your photos on a map, tagged with accurate reverse geocoding.\n- **πŸ“¦ Migration**: Migrate easily from Nextcloud Photos and Google Takeout.\n- **⚑️ Performance**: Do all this very fast.\n\n## πŸš€ Installation\n\n1. Install the app from the Nextcloud app store (try a demo [here](https://demo.memories.gallery/apps/memories/)).\n1. Perform the recommended [configuration steps](https://memories.gallery/config/).\n1. Run `php occ memories:index` to generate metadata indices for existing photos.\n1. Open the πŸ“· Memories app in Nextcloud and set the directory containing your photos.",
     "homepage": "https://memories.gallery",
     "licenses": [
       "agpl"
     ]
   },
+  "music": {
+    "sha256": "06w82v34csx4scl5n4k4fpdxiivrzjb3yvj3hh4bc15gdz68cis9",
+    "url": "https://github.com/owncloud/music/releases/download/v1.9.1/music_1.9.1_for_nextcloud.tar.gz",
+    "version": "1.9.1",
+    "description": "A stand-alone music player app and a \"lite\" player for the Files app\n\n- On modern browsers, supports audio types .mp3, .ogg, .m4a, .m4b, .flac, .wav, and more\n- Playlist support with import from m3u, m3u8, and pls files\n- Browse by artists, albums, genres, or folders\n- Gapless play\n- Filter the shown content with the search function\n- Play internet radio and podcast channels\n- Setup Last.fm connection to see background information on artists, albums, and songs\n- Control with media control keys on the keyboard or OS\n- The app can handle libraries consisting of thousands of albums and tens of thousands of songs\n- Includes a server backend compatible with the Subsonic and Ampache protocols, allowing playback and browsing of your library on various external apps e.g. on Android or iPhone",
+    "homepage": "https://github.com/owncloud/music",
+    "licenses": [
+      "agpl"
+    ]
+  },
   "news": {
     "sha256": "1bkh73h0ibxyjpy3cmvhnlr7isvgqkcxdw2dw15mxksj2cln9wki",
     "url": "https://github.com/nextcloud/news/releases/download/24.0.0/news.tar.gz",
@@ -160,9 +180,9 @@
     ]
   },
   "notify_push": {
-    "sha256": "0hdxnkar2ibis5p0gp3yr1i6894la9wxq4pzrbqdrq2cgvsj6a18",
-    "url": "https://github.com/nextcloud-releases/notify_push/releases/download/v0.6.3/notify_push-v0.6.3.tar.gz",
-    "version": "0.6.3",
+    "sha256": "0lwyy1pnyfw464vab1v5k8q0rgarrj5w12cf1nsywjaafb8y1ym0",
+    "url": "https://github.com/nextcloud-releases/notify_push/releases/download/v0.6.5/notify_push-v0.6.5.tar.gz",
+    "version": "0.6.5",
     "description": "Push update support for desktop app.\n\nOnce the app is installed, the push binary needs to be setup. You can either use the setup wizard with `occ notify_push:setup` or see the [README](http://github.com/nextcloud/notify_push) for detailed setup instructions",
     "homepage": "",
     "licenses": [
@@ -180,9 +200,9 @@
     ]
   },
   "polls": {
-    "sha256": "1v5zb164f60qskfiv02l9x2v0d4rayacg5qivd70dawmyqnz4vmd",
-    "url": "https://github.com/nextcloud/polls/releases/download/v5.3.2/polls.tar.gz",
-    "version": "5.3.2",
+    "sha256": "1dmws4ybv3pzxz5g9c7ghblx0nfal2ssmsg7hjcs1n4xcjc6585p",
+    "url": "https://github.com/nextcloud/polls/releases/download/v5.4.2/polls.tar.gz",
+    "version": "5.4.2",
     "description": "A polls app, similar to Doodle/Dudle with the possibility to restrict access (members, certain groups/users, hidden and public).",
     "homepage": "https://github.com/nextcloud/polls",
     "licenses": [
@@ -240,9 +260,9 @@
     ]
   },
   "twofactor_nextcloud_notification": {
-    "sha256": "03fp8wcwhyp8ivrcf20klgg17sxc9fia5sa44rbrv3cicmwmw50b",
-    "url": "https://github.com/nextcloud-releases/twofactor_nextcloud_notification/releases/download/v3.7.0/twofactor_nextcloud_notification-v3.7.0.tar.gz",
-    "version": "3.7.0",
+    "sha256": "0gaqgzbryim580dxarak7p4g3wd8wp3w6lw9jhl84jh46wrsbrj8",
+    "url": "https://github.com/nextcloud-releases/twofactor_nextcloud_notification/releases/download/v3.8.0/twofactor_nextcloud_notification-v3.8.0.tar.gz",
+    "version": "3.8.0",
     "description": "Allows using any of your logged in devices as second factor",
     "homepage": "https://github.com/nextcloud/twofactor_nextcloud_notification",
     "licenses": [
@@ -250,9 +270,9 @@
     ]
   },
   "twofactor_webauthn": {
-    "sha256": "1lqcw74rsnl8c4sirw9208ra3c8zl8zp93scs7y8fv2n4n60l465",
-    "url": "https://github.com/nextcloud-releases/twofactor_webauthn/releases/download/v1.2.0/twofactor_webauthn-v1.2.0.tar.gz",
-    "version": "1.2.0",
+    "sha256": "0z6m2chq5kxc8f10g6n1lh51yi10svy2qp5gp0v8xs71apqcc2wx",
+    "url": "https://github.com/nextcloud-releases/twofactor_webauthn/releases/download/v1.3.0/twofactor_webauthn-v1.3.0.tar.gz",
+    "version": "1.3.0",
     "description": "A two-factor provider for WebAuthn devices",
     "homepage": "https://github.com/nextcloud/twofactor_webauthn#readme",
     "licenses": [
@@ -270,9 +290,9 @@
     ]
   },
   "user_saml": {
-    "sha256": "1gsq5mcn5nnxd56jlp4j2610gqq2gk3ma9yvhgy74wl0sqil98jd",
-    "url": "https://github.com/nextcloud-releases/user_saml/releases/download/v5.2.2/user_saml-v5.2.2.tar.gz",
-    "version": "5.2.2",
+    "sha256": "04ivgqdls72p6x5yrh5p5ycbbfmxhzd0dqin1grblm6cbl7b4s2k",
+    "url": "https://github.com/nextcloud-releases/user_saml/releases/download/v5.2.4/user_saml-v5.2.4.tar.gz",
+    "version": "5.2.4",
     "description": "Using the SSO & SAML app of your Nextcloud you can make it easily possible to integrate your existing Single-Sign-On solution with Nextcloud. In addition, you can use the Nextcloud LDAP user provider to keep the convenience for users. (e.g. when sharing)\nThe following providers are supported and tested at the moment:\n\n* **SAML 2.0**\n\t* OneLogin\n\t* Shibboleth\n\t* Active Directory Federation Services (ADFS)\n\n* **Authentication via Environment Variable**\n\t* Kerberos (mod_auth_kerb)\n\t* Any other provider that authenticates using the environment variable\n\nWhile theoretically any other authentication provider implementing either one of those standards is compatible, we like to note that they are not part of any internal test matrix.",
     "homepage": "https://github.com/nextcloud/user_saml",
     "licenses": [
diff --git a/pkgs/servers/nextcloud/packages/nextcloud-apps.json b/pkgs/servers/nextcloud/packages/nextcloud-apps.json
index bbbe556f6cbe..8b6f49c524c5 100644
--- a/pkgs/servers/nextcloud/packages/nextcloud-apps.json
+++ b/pkgs/servers/nextcloud/packages/nextcloud-apps.json
@@ -2,6 +2,7 @@
   "bookmarks": "agpl3Plus"
 , "calendar": "agpl3Plus"
 , "contacts": "agpl3Plus"
+, "cookbook": "agpl3Plus"
 , "cospend": "agpl3Plus"
 , "deck": "agpl3Plus"
 , "files_texteditor": "agpl3Plus"
@@ -13,6 +14,7 @@
 , "mail": "agpl3Plus"
 , "maps": "agpl3Plus"
 , "memories": "agpl3Plus"
+, "music": "agpl3Plus"
 , "news": "agpl3Plus"
 , "notes": "agpl3Plus"
 , "notify_push": "agpl3Plus"
diff --git a/pkgs/servers/slimserver/default.nix b/pkgs/servers/slimserver/default.nix
index f561eec0bac8..08d9dbe97e6f 100644
--- a/pkgs/servers/slimserver/default.nix
+++ b/pkgs/servers/slimserver/default.nix
@@ -5,13 +5,18 @@
 , lib
 , makeWrapper
 , monkeysAudio
-, perlPackages
+, nixosTests
+, perl538Packages
 , sox
 , stdenv
 , wavpack
 , zlib
+, enableUnfreeFirmware ? false
 }:
 
+let
+  perlPackages = perl538Packages;
+in
 perlPackages.buildPerlPackage rec {
   pname = "slimserver";
   version = "8.3.1";
@@ -25,10 +30,99 @@ perlPackages.buildPerlPackage rec {
 
   nativeBuildInputs = [ makeWrapper ];
 
-  buildInputs = [ perlPackages.CryptOpenSSLRSA perlPackages.IOSocketSSL ];
+  buildInputs = with perlPackages; [
+    AnyEvent
+    ArchiveZip
+    AsyncUtil
+    AudioScan
+    CarpClan
+    CGI
+    ClassAccessor
+    ClassAccessorChained
+    ClassC3
+    # ClassC3Componentised # Error: DBIx::Class::Row::throw_exception(): DBIx::Class::Relationship::BelongsTo::belongs_to(): Can't infer join condition for track
+    ClassDataInheritable
+    ClassInspector
+    ClassISA
+    ClassMember
+    ClassSingleton
+    ClassVirtual
+    ClassXSAccessor
+    CompressRawZlib
+    CryptOpenSSLRSA
+    DataDump
+    DataPage
+    DataURIEncode
+    DBDSQLite
+    DBI
+    # DBIxClass # https://github.com/Logitech/slimserver/issues/138
+    DigestSHA1
+    EncodeDetect
+    EV
+    ExporterLite
+    FileBOM
+    FileCopyRecursive
+    FileNext
+    FileReadBackwards
+    FileSlurp
+    FileWhich
+    HTMLParser
+    HTTPCookies
+    HTTPDaemon
+    HTTPMessage
+    ImageScale
+    IOAIO
+    IOInterface
+    IOSocketSSL
+    IOString
+    JSONXS
+    JSONXSVersionOneAndTwo
+    # LogLog4perl # Internal error: Root Logger not initialized.
+    LWP
+    LWPProtocolHttps
+    MP3CutGapless
+    NetHTTP
+    NetHTTPSNB
+    PathClass
+    ProcBackground
+    # SQLAbstract # DBI Exception: DBD::SQLite::db prepare_cached failed: no such function: ARRAY
+    SQLAbstractLimit
+    SubName
+    TemplateToolkit
+    TextUnidecode
+    TieCacheLRU
+    TieCacheLRUExpires
+    TieRegexpHash
+    TimeDate
+    URI
+    URIFind
+    UUIDTiny
+    XMLParser
+    XMLSimple
+    YAMLLibYAML
+  ]
+  # ++ (lib.optional stdenv.isDarwin perlPackages.MacFSEvents)
+  ++ (lib.optional stdenv.isLinux perlPackages.LinuxInotify2);
 
   prePatch = ''
+    # remove vendored binaries
     rm -rf Bin
+
+    # remove most vendored modules, keeping necessary ones
+    mkdir -p CPAN_used/Class/C3/ CPAN_used/SQL
+    rm -r CPAN/SQL/Abstract/Limit.pm
+    cp -rv CPAN/Class/C3/Componentised.pm CPAN_used/Class/C3/
+    cp -rv CPAN/DBIx CPAN_used/
+    cp -rv CPAN/Log CPAN_used/
+    cp -rv CPAN/SQL/* CPAN_used/SQL/
+    rm -r CPAN
+    mv CPAN_used CPAN
+
+    ${lib.optionalString (!enableUnfreeFirmware) ''
+      # remove unfree firmware
+      rm -rf Firmware
+    ''}
+
     touch Makefile.PL
   '';
 
@@ -38,18 +132,26 @@ perlPackages.buildPerlPackage rec {
     cp -r . $out
     wrapProgram $out/slimserver.pl \
       --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ zlib stdenv.cc.cc.lib ]}" \
-      --prefix PATH : "${lib.makeBinPath [ lame flac faad2 sox monkeysAudio wavpack ]}"
+      --prefix PATH : "${lib.makeBinPath ([ lame flac faad2 sox wavpack ] ++ (lib.optional stdenv.isLinux monkeysAudio))}"
+    mkdir $out/bin
+    ln -s $out/slimserver.pl $out/bin/slimserver
   '';
 
   outputs = [ "out" ];
 
+  passthru.tests = {
+    inherit (nixosTests) slimserver;
+  };
+
   meta = with lib; {
     homepage = "https://github.com/Logitech/slimserver";
     description = "Server for Logitech Squeezebox players. This server is also called Logitech Media Server";
-    # the firmware is not under a free license!
+    # the firmware is not under a free license, but not included in the default package
     # https://github.com/Logitech/slimserver/blob/public/8.3/License.txt
-    license = licenses.unfree;
+    license = if enableUnfreeFirmware then licenses.unfree else licenses.gpl2Only;
+    mainProgram = "slimserver";
     maintainers = with maintainers; [ adamcstephens jecaro ];
     platforms = platforms.unix;
+    broken = stdenv.isDarwin;
   };
 }
diff --git a/pkgs/test/default.nix b/pkgs/test/default.nix
index d8c5f3208bca..9543e165a805 100644
--- a/pkgs/test/default.nix
+++ b/pkgs/test/default.nix
@@ -67,7 +67,6 @@ with pkgs;
             # libcxx does not build for some reason on aarch64-linux
             (filterAttrs (n: _: n != "llvmPackages_7"))
           ] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
-            (filterAttrs (n: _: n != "llvmPackages_5"))
             (filterAttrs (n: _: n != "llvmPackages_6"))
             (filterAttrs (n: _: n != "llvmPackages_7"))
             (filterAttrs (n: _: n != "llvmPackages_8"))
diff --git a/pkgs/tools/filesystems/bcachefs-tools/default.nix b/pkgs/tools/filesystems/bcachefs-tools/default.nix
index e6263ca62c67..918f0bd841d7 100644
--- a/pkgs/tools/filesystems/bcachefs-tools/default.nix
+++ b/pkgs/tools/filesystems/bcachefs-tools/default.nix
@@ -18,20 +18,19 @@
 , rustc
 , rustPlatform
 , makeWrapper
+, writeScript
 , fuseSupport ? false
 }:
-let
-  version = "1.3.3";
-in
-stdenv.mkDerivation {
+
+stdenv.mkDerivation (finalAttrs: {
   pname = "bcachefs-tools";
-  inherit version;
+  version = "1.3.3";
 
 
   src = fetchFromGitHub {
     owner = "koverstreet";
     repo = "bcachefs-tools";
-    rev = "v${version}";
+    rev = "v${finalAttrs.version}";
     hash = "sha256-73vgwgBqyRLQ/Tts7bl6DhZMOs8ndIOiCke5tN89Wps=";
   };
 
@@ -71,7 +70,7 @@ stdenv.mkDerivation {
 
   makeFlags = [
     "PREFIX=${placeholder "out"}"
-    "VERSION=${version}"
+    "VERSION=${finalAttrs.version}"
     "INITRAMFS_DIR=${placeholder "out"}/etc/initramfs-tools"
   ];
 
@@ -79,9 +78,24 @@ stdenv.mkDerivation {
     rm tests/test_fuse.py
   '';
 
-  passthru.tests = {
-    smoke-test = nixosTests.bcachefs;
-    inherit (nixosTests.installer) bcachefsSimple bcachefsEncrypted bcachefsMulti;
+  passthru = {
+    tests = {
+      smoke-test = nixosTests.bcachefs;
+      inherit (nixosTests.installer) bcachefsSimple bcachefsEncrypted bcachefsMulti;
+    };
+
+    updateScript = writeScript "update-bcachefs-tools-and-cargo-lock.sh" ''
+      #!/usr/bin/env nix-shell
+      #!nix-shell -i bash -p curl jq common-updater-scripts
+      res="$(curl ''${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \
+        -sL "https://api.github.com/repos/${finalAttrs.src.owner}/${finalAttrs.src.repo}/tags?per_page=1")"
+
+      version="$(echo $res | jq '.[0].name | split("v") | .[1]' --raw-output)"
+      update-source-version ${finalAttrs.pname} "$version" --ignore-same-hash
+
+      curl "https://raw.githubusercontent.com/${finalAttrs.src.owner}/${finalAttrs.src.repo}/v$version/rust-src/Cargo.lock" > \
+        "$(git rev-parse --show-toplevel)/pkgs/tools/filesystems/bcachefs-tools/Cargo.lock"
+    '';
   };
 
   enableParallelBuilding = true;
@@ -93,4 +107,4 @@ stdenv.mkDerivation {
     maintainers = with maintainers; [ davidak Madouura ];
     platforms = platforms.linux;
   };
-}
+})
diff --git a/pkgs/tools/misc/bootspec/default.nix b/pkgs/tools/misc/bootspec/default.nix
index 7bf6bc478d7c..2ffa6c47ab09 100644
--- a/pkgs/tools/misc/bootspec/default.nix
+++ b/pkgs/tools/misc/bootspec/default.nix
@@ -1,6 +1,7 @@
 { lib
 , rustPlatform
 , fetchFromGitHub
+, fetchpatch
 }:
 rustPlatform.buildRustPackage rec {
   pname = "bootspec";
@@ -13,6 +14,17 @@ rustPlatform.buildRustPackage rec {
     hash = "sha256-5IGSMHeL0eKfl7teDejAckYQjc8aeLwfwIQSzQ8YaAg=";
   };
 
+  patches = [
+    # https://github.com/DeterminateSystems/bootspec/pull/127
+    # Fixes the synthesize tool for aarch64-linux
+    (fetchpatch {
+      name = "aarch64-support.patch";
+      url = "https://github.com/DeterminateSystems/bootspec/commit/1d0e925f360f0199f13422fb7541225fd162fd4f.patch";
+      sha256 = "sha256-wU/jWnOqVBrU2swANdXbQfzRpNd/JIS4cxSyCvixZM0=";
+    })
+
+  ];
+
   cargoHash = "sha256-eGSKVHjPnHK7WyGkO5LIjocNGHawahYQR3H5Lgk1C9s=";
 
   meta = with lib; {
diff --git a/pkgs/tools/package-management/xbps/default.nix b/pkgs/tools/package-management/xbps/default.nix
index c948c66b47f1..07aa1a7accc1 100644
--- a/pkgs/tools/package-management/xbps/default.nix
+++ b/pkgs/tools/package-management/xbps/default.nix
@@ -1,14 +1,14 @@
-{ lib, stdenv, fetchFromGitHub, fetchpatch, pkg-config, which, zlib, openssl, libarchive }:
+{ lib, stdenv, fetchFromGitHub, pkg-config, which, zlib, openssl, libarchive }:
 
 stdenv.mkDerivation rec {
   pname = "xbps";
-  version = "0.59.1";
+  version = "0.59.2";
 
   src = fetchFromGitHub {
     owner = "void-linux";
     repo = "xbps";
     rev = version;
-    sha256 = "0pab3xf97y4wqlyrb92zxd3cfsrbnlx6pssbw4brgwcxccw9jrhy";
+    hash = "sha256-3+LzFLDZ1zfRPBETMlpEn66zsfHRHQLlgeZPdMtmA14=";
   };
 
   nativeBuildInputs = [ pkg-config which ];
@@ -17,16 +17,17 @@ stdenv.mkDerivation rec {
 
   patches = [
     ./cert-paths.patch
-    # fix openssl 3
-    (fetchpatch {
-      url = "https://github.com/void-linux/xbps/commit/db1766986c4389eb7e17c0e0076971b711617ef9.patch";
-      hash = "sha256-CmyZdsHStPsELdEgeJBWIbXIuVeBhv7VYb2uGYxzUWQ=";
-    })
   ];
 
   env.NIX_CFLAGS_COMPILE = "-Wno-error=unused-result -Wno-error=deprecated-declarations";
 
   postPatch = ''
+    # _BSD_SOURCE causes cpp warning
+    # https://github.com/void-linux/xbps/issues/576
+    substituteInPlace bin/xbps-fbulk/main.c lib/util.c lib/external/dewey.c lib/external/fexec.c \
+      --replace 'define _BSD_SOURCE' 'define _DEFAULT_SOURCE' \
+      --replace '# define _BSD_SOURCE' '#define _DEFAULT_SOURCE'
+
     # fix unprefixed ranlib (needed on cross)
     substituteInPlace lib/Makefile \
       --replace 'SILENT}ranlib ' 'SILENT}$(RANLIB) '
diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix
index 22d68425f928..716ead49c30f 100644
--- a/pkgs/top-level/aliases.nix
+++ b/pkgs/top-level/aliases.nix
@@ -162,7 +162,6 @@ mapAliases ({
   cvs_fast_export = cvs-fast-export; # Added 2021-06-10
 
   # these are for convenience, not for backward compat and shouldn't expire
-  clang5Stdenv = lowPrio llvmPackages_5.stdenv;
   clang6Stdenv = lowPrio llvmPackages_6.stdenv;
   clang7Stdenv = lowPrio llvmPackages_7.stdenv;
   clang8Stdenv = lowPrio llvmPackages_8.stdenv;
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index e9db16541597..c0e320b4bbf8 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -9987,6 +9987,8 @@ with pkgs;
 
   lldpd = callPackage ../tools/networking/lldpd { };
 
+  llm = with python3Packages; toPythonApplication llm;
+
   lnav = callPackage ../tools/misc/lnav { };
 
   lnch = callPackage ../tools/misc/lnch { };
@@ -15632,7 +15634,6 @@ with pkgs;
   };
 
   clang = llvmPackages.clang;
-  clang_5  = llvmPackages_5.clang;
   clang_6  = llvmPackages_6.clang;
   clang_7  = llvmPackages_7.clang;
   clang_8  = llvmPackages_8.clang;
@@ -15649,10 +15650,6 @@ with pkgs;
     llvmPackages = llvmPackages_14;
   };
 
-  clang-tools_5 = callPackage ../development/tools/clang-tools {
-    llvmPackages = llvmPackages_5;
-  };
-
   clang-tools_6 = callPackage ../development/tools/clang-tools {
     llvmPackages = llvmPackages_6;
   };
@@ -16585,7 +16582,6 @@ with pkgs;
   };
 
   lld = llvmPackages.lld;
-  lld_5 = llvmPackages_5.lld;
   lld_6 = llvmPackages_6.lld;
   lld_7 = llvmPackages_7.lld;
   lld_8 = llvmPackages_8.lld;
@@ -16599,7 +16595,6 @@ with pkgs;
   lld_16 = llvmPackages_16.lld;
 
   lldb = lldb_14;
-  lldb_5 = llvmPackages_5.lldb;
   lldb_6 = llvmPackages_6.lldb;
   lldb_7 = llvmPackages_7.lldb;
   lldb_8 = llvmPackages_8.lldb;
@@ -16613,7 +16608,6 @@ with pkgs;
   lldb_16 = llvmPackages_16.lldb;
 
   llvm = llvmPackages.llvm;
-  llvm_5  = llvmPackages_5.llvm;
   llvm_6  = llvmPackages_6.llvm;
   llvm_7  = llvmPackages_7.llvm;
   llvm_8  = llvmPackages_8.llvm;
@@ -16646,13 +16640,6 @@ with pkgs;
       stdenv.targetPlatform));
   in pkgs.${"llvmPackages_${minSupported}"};
 
-  llvmPackages_5 = recurseIntoAttrs (callPackage ../development/compilers/llvm/5 {
-    inherit (stdenvAdapters) overrideCC;
-    buildLlvmTools = buildPackages.llvmPackages_5.tools;
-    targetLlvm = targetPackages.llvmPackages_5.llvm or llvmPackages_5.llvm;
-    targetLlvmLibraries = targetPackages.llvmPackages_5.libraries or llvmPackages_5.libraries;
-  });
-
   llvmPackages_6 = recurseIntoAttrs (callPackage ../development/compilers/llvm/6 {
     inherit (stdenvAdapters) overrideCC;
     buildLlvmTools = buildPackages.llvmPackages_6.tools;
@@ -17746,7 +17733,7 @@ with pkgs;
   ### End of CuboCore
 
   maude = callPackage ../development/interpreters/maude {
-    stdenv = if stdenv.cc.isClang then llvmPackages_5.stdenv else stdenv;
+    stdenv = if stdenv.cc.isClang then llvmPackages_7.stdenv else stdenv;
   };
 
   me_cleaner = callPackage ../tools/misc/me_cleaner { };
@@ -18030,7 +18017,6 @@ with pkgs;
     mkRubyVersion
     mkRuby
     ruby_2_7
-    ruby_3_0
     ruby_3_1
     ruby_3_2
     ruby_3_3;
@@ -18039,7 +18025,6 @@ with pkgs;
   rubyPackages = rubyPackages_3_1;
 
   rubyPackages_2_7 = recurseIntoAttrs ruby_2_7.gems;
-  rubyPackages_3_0 = recurseIntoAttrs ruby_3_0.gems;
   rubyPackages_3_1 = recurseIntoAttrs ruby_3_1.gems;
   rubyPackages_3_2 = recurseIntoAttrs ruby_3_2.gems;
   rubyPackages_3_3 = recurseIntoAttrs ruby_3_3.gems;
@@ -26555,6 +26540,8 @@ with pkgs;
 
   jicofo = callPackage ../servers/jicofo { };
 
+  jitsi-excalidraw = callPackage ../servers/jitsi-excalidraw { };
+
   jitsi-meet = callPackage ../servers/web-apps/jitsi-meet { };
 
   jitsi-meet-prosody = callPackage ../misc/jitsi-meet-prosody { };
@@ -37674,6 +37661,9 @@ with pkgs;
 
   deliantra-server = callPackage ../games/deliantra/server.nix {
     stdenv = gcc10StdenvCompat;
+    # perl538 defines 'struct object' in sv.h. many conflicts result
+    perl = perl536;
+    perlPackages = perl536Packages;
   };
   deliantra-arch = callPackage ../games/deliantra/arch.nix {
     stdenv = gcc10StdenvCompat;
@@ -40009,7 +39999,7 @@ with pkgs;
 
   root5 = lowPrio (callPackage ../applications/science/misc/root/5.nix {
     inherit (darwin.apple_sdk.frameworks) Cocoa OpenGL;
-    stdenv = if stdenv.cc.isClang then llvmPackages_5.stdenv else stdenv;
+    stdenv = if stdenv.cc.isClang then llvmPackages_7.stdenv else stdenv;
   });
 
   rinetd = callPackage ../servers/rinetd { };
diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix
index a884bcd34618..47484eaf80f5 100644
--- a/pkgs/top-level/perl-packages.nix
+++ b/pkgs/top-level/perl-packages.nix
@@ -1169,6 +1169,20 @@ with self; {
     };
   };
 
+  AsyncUtil = buildPerlPackage {
+    pname = "Async-Util";
+    version = "0.01";
+    src = fetchurl {
+      url = "mirror://cpan/authors/id/W/WH/WHITNEY/Async-Util-0.01.tar.gz";
+      hash = "sha256-jzKxHKvFD2Xjh79W8mWBV6IsNah5Nmbhtfis/hMQkQY=";
+    };
+    buildInputs = [ AnyEvent ListMoreUtils ];
+    meta = {
+      description = "Utilities for doing common async operations";
+      license = with lib.licenses; [ artistic1 gpl1Plus ];
+    };
+  };
+
   ArchiveCpio = buildPerlPackage {
     pname = "Archive-Cpio";
     version = "0.10";
@@ -1253,6 +1267,18 @@ with self; {
     };
   };
 
+  AudioCuefileParser = buildPerlPackage {
+    pname = "Audio-Cuefile-Parser";
+    version = "0.02";
+    src = fetchurl {
+      url = "mirror://cpan/authors/id/M/MA/MATTK/Audio-Cuefile-Parser-0.02.tar.gz";
+      hash = "sha256-ulbQcMhz2WxoatmoH99P6JuETkPrSd/gAL+c70PFtmk=";
+    };
+    meta = {
+      license = with lib.licenses; [ artistic1 gpl1Plus ];
+    };
+  };
+
   AudioFLACHeader = buildPerlPackage {
     pname = "Audio-FLAC-Header";
     version = "2.4";
@@ -3602,6 +3628,19 @@ with self; {
     };
   };
 
+  ClassMember = buildPerlPackage {
+    pname = "Class-Member";
+    version = "1.6";
+    src = fetchurl {
+      url = "mirror://cpan/authors/id/O/OP/OPI/Class-Member-1.6.tar.gz";
+      hash = "sha256-p1KK8in6OhIF3NJakd59dKxvp9lSgbmTtV6Lb0+HuZE=";
+    };
+    meta = {
+      description = "A set of modules to make the module developement easier";
+      license = with lib.licenses; [ artistic1 gpl1Plus ];
+    };
+  };
+
   ClassMethodMaker = buildPerlPackage {
     pname = "Class-MethodMaker";
     version = "2.24";
@@ -12712,6 +12751,19 @@ with self; {
     };
   };
 
+  IOInterface = buildPerlModule {
+    pname = "IO-Interface";
+    version = "1.09";
+    src = fetchurl {
+      url = "mirror://cpan/authors/id/L/LD/LDS/IO-Interface-1.09.tar.gz";
+      hash = "sha256-5j6BxS6x4OYOwtmD9VUtJJPhFxeZJclnV/I8S9n6cTo=";
+    };
+    meta = {
+      description = "Access and modify network interface card configuration";
+      license = with lib.licenses; [ artistic1 gpl1Plus ];
+    };
+  };
+
   IOInteractive = buildPerlPackage {
     pname = "IO-Interactive";
     version = "1.025";
@@ -17933,6 +17985,20 @@ with self; {
     };
   };
 
+  MP3CutGapless = buildPerlPackage {
+    pname = "MP3-Cut-Gapless";
+    version = "0.03";
+    src = fetchurl {
+      url = "mirror://cpan/authors/id/A/AG/AGRUNDMA/MP3-Cut-Gapless-0.03.tar.gz";
+      hash = "sha256-PoS3OdHx4902FvhR3GV14WXTKEZ/AySGB5UOWVH+pPM=";
+    };
+    propagatedBuildInputs = [ AudioCuefileParser ];
+    meta = {
+      description = "Split an MP3 file without gaps (based on pcutmp3)";
+      license = with lib.licenses; [ artistic1 ];
+    };
+  };
+
   MP3Info = buildPerlPackage {
     pname = "MP3-Info";
     version = "1.26";
diff --git a/pkgs/top-level/pkg-config/pkg-config-data.json b/pkgs/top-level/pkg-config/pkg-config-data.json
index 4578b0f92b25..50eae9ac572d 100644
--- a/pkgs/top-level/pkg-config/pkg-config-data.json
+++ b/pkgs/top-level/pkg-config/pkg-config-data.json
@@ -773,11 +773,6 @@
         "ruby_2_7"
       ]
     },
-    "ruby-3.0": {
-      "attrPath": [
-        "ruby_3_0"
-      ]
-    },
     "ruby-3.1": {
       "attrPath": [
         "ruby_3_1"
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index f21dc11dd49c..0a2f0fea4627 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -6390,6 +6390,8 @@ self: super: with self; {
     inherit (pkgs) fuse;
   };
 
+  llm = callPackage ../development/python-modules/llm { };
+
   llvmlite = callPackage ../development/python-modules/llvmlite {
     # llvmlite always requires a specific version of llvm.
     llvm = pkgs.llvm_14;
diff --git a/pkgs/top-level/release.nix b/pkgs/top-level/release.nix
index 63679dd28f04..a8e9f397c0bf 100644
--- a/pkgs/top-level/release.nix
+++ b/pkgs/top-level/release.nix
@@ -143,10 +143,12 @@ let
 
               jobs.tests.cc-wrapper.llvmPackages.clang.x86_64-linux
               jobs.tests.cc-wrapper.llvmPackages.libcxx.x86_64-linux
-              jobs.tests.cc-wrapper.llvmPackages_5.clang.x86_64-linux
-              jobs.tests.cc-wrapper.llvmPackages_5.libcxx.x86_64-linux
               jobs.tests.cc-wrapper.llvmPackages_6.clang.x86_64-linux
               jobs.tests.cc-wrapper.llvmPackages_6.libcxx.x86_64-linux
+              jobs.tests.cc-wrapper.llvmPackages_7.clang.x86_64-linux
+              jobs.tests.cc-wrapper.llvmPackages_7.libcxx.x86_64-linux
+              jobs.tests.cc-wrapper.llvmPackages_7.clang.x86_64-linux
+              jobs.tests.cc-wrapper.llvmPackages_7.libcxx.x86_64-linux
               jobs.tests.cc-multilib-gcc.x86_64-linux
               jobs.tests.cc-multilib-clang.x86_64-linux
               jobs.tests.stdenv-inputs.x86_64-linux