nushell: Add pluggin support tests

This commit is contained in:
Joaquín Triñanes 2024-06-04 20:56:55 +02:00
parent 28e62eb5eb
commit c580fa5960
No known key found for this signature in database
GPG key ID: 6E1446DD451C6BAF
2 changed files with 26 additions and 1 deletions

View file

@ -1 +1,4 @@
{ nushell-example-settings = ./example-settings.nix; }
{
nushell-example-settings = ./example-settings.nix;
nushell-plugins = ./plugins.nix;
}

View file

@ -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}"
'';
}