flarum: rename to flarum_1

This commit is contained in:
fsagbuya
2026-10-13 17:14:10 +08:00
parent 06b605c82c
commit cbab75cd5e
7 changed files with 40 additions and 6 deletions

View File

@@ -396,6 +396,12 @@
- `services.porn-vault.settings` may need changes when using non-default options, due to upstream changes. Chack the new default module config for reference.
- Flarum 2 is now available as `pkgs.flarum_2`. Flarum 1 has moved to `pkgs.flarum_1`, and `pkgs.flarum` is now a deprecated alias for it. [`services.flarum.package`](#opt-services.flarum.package) now defaults to:
- `pkgs.flarum_1` if [`system.stateVersion`](#opt-system.stateVersion) is older than 26.11, so existing installations keep running Flarum 1;
- `pkgs.flarum_2` otherwise.
Switching an existing installation to `pkgs.flarum_2` upgrades its database in place, which can't be undone. Back up the database first, and make sure every installed extension has a release for Flarum 2.
## Other Notable Changes {#sec-release-26.11-notable-changes}
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->

View File

@@ -66,7 +66,24 @@ in
options.services.flarum = {
enable = mkEnableOption "Flarum discussion platform";
package = mkPackageOption pkgs "flarum" { };
package = mkOption {
type = types.package;
default = if versionOlder config.system.stateVersion "26.11" then pkgs.flarum_1 else pkgs.flarum_2;
defaultText = literalExpression ''
if versionOlder config.system.stateVersion "26.11" then pkgs.flarum_1 else pkgs.flarum_2
'';
relatedPackages = [
"flarum_1"
"flarum_2"
];
description = ''
Flarum package to use.
Upgrading from Flarum 1.x to 2.x migrates the database and can't be
undone, so back up the database and make sure all extensions support
Flarum 2 before switching.
'';
};
forumTitle = mkOption {
type = types.str;

View File

@@ -689,7 +689,14 @@ in
flannel = runTestOn [ "x86_64-linux" ] ./flannel.nix;
flap-alerted = runTest ./flap-alerted.nix;
flaresolverr = runTest ./flaresolverr.nix;
flarum = runTest ./flarum.nix;
flarum_1 = runTest {
imports = [ ./flarum.nix ];
_module.args.package = pkgs.flarum_1;
};
flarum_2 = runTest {
imports = [ ./flarum.nix ];
_module.args.package = pkgs.flarum_2;
};
flood = runTest ./flood.nix;
fluent-bit = runTest ./fluent-bit.nix;
fluentd = runTest ./fluentd.nix;

View File

@@ -1,6 +1,6 @@
{ lib, ... }:
{ lib, package, ... }:
{
name = "flarum";
name = "flarum-${package.version}";
meta = {
maintainers = with lib.maintainers; [
@@ -18,6 +18,7 @@
services.flarum = {
enable = true;
inherit package;
forumTitle = "NixOS Flarum Test Forum";
domain = "localhost";
baseUrl = "http://localhost";

View File

@@ -6,6 +6,8 @@
}:
php.buildComposerProject2 (finalAttrs: {
__structuredAttrs = true;
pname = "flarum";
version = "1.8.19";
@@ -21,10 +23,10 @@ php.buildComposerProject2 (finalAttrs: {
composerLock = ./composer.lock;
vendorHash = "sha256-EXKQ9x7E15Fc4fu/XdjlgMDCpmvg1XupBGq13WDspDI=";
passthru.tests.module = nixosTests.flarum;
passthru.tests.module = nixosTests.flarum_1;
meta = {
changelog = "https://github.com/flarum/framework/blob/main/CHANGELOG.md";
changelog = "https://github.com/flarum/framework/blob/1.x/CHANGELOG.md";
description = "Delightfully simple discussion platform for your website";
homepage = "https://github.com/flarum/flarum";
license = lib.licenses.mit;

View File

@@ -886,6 +886,7 @@ mapAliases {
fishy = throw "'fishy' has been removed because it was unmaintained upstream"; # Added 2026-08-18
fit-trackee = throw "'fit-trackee' has been renamed to/replaced by 'fittrackee'"; # Converted to throw 2025-10-27
fixup_yarn_lock = throw "`fixup_yarn_lock` has been removed, please use `fixup-yarn-lock` instead."; # Added 2026-04-25
flarum = warnAlias "'flarum' has been renamed to 'flarum_1'. Use 'flarum_1', or 'flarum_2' to upgrade (this migrates the database and can't be undone)." flarum_1; # Added 2026-10-14
flashrom-stable = throw "'flashrom-stable' has been renamed to/replaced by 'flashprog'"; # Converted to throw 2025-10-27
flatbuffers_2_0 = throw "'flatbuffers_2_0' has been renamed to/replaced by 'flatbuffers'"; # Converted to throw 2025-10-27
flattenReferencesGraph = warnAlias "'flattenReferencesGraph' has been renamed to 'flatten-references-graph'" flatten-references-graph; # Added 2026-02-08