From a4cadd9cfa69ce0cf0473b4ba76a671d483304c2 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 4 Aug 2025 15:23:50 +0200 Subject: [PATCH] discourse: fix passthru nixos test --- nixos/tests/all-tests.nix | 9 ++++++++- nixos/tests/discourse.nix | 6 ++---- pkgs/servers/web-apps/discourse/default.nix | 14 +++++++------- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 76867b74b49d..2784afd2ee87 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -422,7 +422,14 @@ in dex-oidc = runTest ./dex-oidc.nix; dhparams = runTest ./dhparams.nix; disable-installer-tools = runTest ./disable-installer-tools.nix; - discourse = runTest ./discourse.nix; + discourse = runTest { + imports = [ ./discourse.nix ]; + _module.args.package = pkgs.discourse; + }; + discourseAllPlugins = runTest { + imports = [ ./discourse.nix ]; + _module.args.package = pkgs.discourseAllPlugins; + }; dnscrypt-proxy2 = runTestOn [ "x86_64-linux" ] ./dnscrypt-proxy2.nix; dnsdist = import ./dnsdist.nix { inherit pkgs runTest; }; doas = runTest ./doas.nix; diff --git a/nixos/tests/discourse.nix b/nixos/tests/discourse.nix index e76d0a3862ba..e4b15cd10076 100644 --- a/nixos/tests/discourse.nix +++ b/nixos/tests/discourse.nix @@ -4,9 +4,9 @@ # 3. replying to that message via email. { + lib, package, pkgs, - lib, ... }: let @@ -26,8 +26,6 @@ in name = "discourse"; meta.maintainers = with lib.maintainers; [ talyz ]; - _module.args.package = lib.mkDefault pkgs.discourse; - nodes.discourse = { nodes, ... }: { @@ -62,7 +60,7 @@ in services.discourse = { enable = true; - inherit admin; + inherit admin package; hostname = discourseDomain; sslCertificate = "${certs.${discourseDomain}.cert}"; sslCertificateKey = "${certs.${discourseDomain}.key}"; diff --git a/pkgs/servers/web-apps/discourse/default.nix b/pkgs/servers/web-apps/discourse/default.nix index 5c3e8b6c1dbc..0a103f914ba9 100644 --- a/pkgs/servers/web-apps/discourse/default.nix +++ b/pkgs/servers/web-apps/discourse/default.nix @@ -8,9 +8,9 @@ fetchFromGitHub, bundlerEnv, callPackage, + nixosTests, ruby_3_3, - replace, gzip, gnutar, git, @@ -43,7 +43,7 @@ uglify-js, plugins ? [ ], -}@args: +}: let version = "3.4.6"; @@ -433,13 +433,13 @@ let enabledPlugins = plugins; plugins = callPackage ./plugins/all-plugins.nix { inherit mkDiscoursePlugin; }; ruby = rubyEnv.wrappedRuby; - tests = import ../../../../nixos/tests/discourse.nix { - inherit (stdenv) system; - inherit pkgs; - package = pkgs.discourse.override args; + tests = { + inherit (nixosTests) + discourse + discourseAllPlugins + ; }; }; - meta = with lib; { homepage = "https://www.discourse.org/"; platforms = platforms.linux;