From c580fa59604ced79ec5a498bc5797903c6bc2b4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Tri=C3=B1anes?= Date: Tue, 4 Jun 2024 20:56:55 +0200 Subject: [PATCH] nushell: Add pluggin support tests --- tests/modules/programs/nushell/default.nix | 5 ++++- tests/modules/programs/nushell/plugins.nix | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 tests/modules/programs/nushell/plugins.nix diff --git a/tests/modules/programs/nushell/default.nix b/tests/modules/programs/nushell/default.nix index 52d9b3c7b..bdf14d56d 100644 --- a/tests/modules/programs/nushell/default.nix +++ b/tests/modules/programs/nushell/default.nix @@ -1 +1,4 @@ -{ nushell-example-settings = ./example-settings.nix; } +{ + nushell-example-settings = ./example-settings.nix; + nushell-plugins = ./plugins.nix; +} diff --git a/tests/modules/programs/nushell/plugins.nix b/tests/modules/programs/nushell/plugins.nix new file mode 100644 index 000000000..818cf7f68 --- /dev/null +++ b/tests/modules/programs/nushell/plugins.nix @@ -0,0 +1,22 @@ +{ pkgs, config, ... }: + +{ + programs.nushell = { + enable = true; + plugins = + builtins.attrValues { inherit (pkgs.nushellPlugins) formats gstat; }; + }; + + test.stubs."nushellPlugins.formats" = { }; + + nmt.script = let + configDir = if pkgs.stdenv.isDarwin && !config.xdg.enable then + "home-files/Library/Application Support/nushell" + else + "home-files/.config/nushell"; + pluginFile = "${configDir}/plugin.msgpackz"; + + in '' + assertFileExists "${pluginFile}" + ''; +}