home-manager/tests/modules/programs/nushell/example-settings.nix
SaiProton e15010ee6e
nushell: add login.nu configuration option
Nushell has the option to source from the login.nu file in the case
that nushell is used as a login shell. This commit adds the login file
alongside the existing config and env files as another configuration
option.
2023-07-08 23:58:37 +02:00

53 lines
1 KiB
Nix

{ pkgs, ... }:
{
programs.nushell = {
enable = true;
configFile.text = ''
let $config = {
filesize_metric: false
table_mode: rounded
use_ls_colors: true
}
'';
envFile.text = ''
let-env FOO = 'BAR'
'';
loginFile.text = ''
# Prints "Hello, World" upon logging into tty1
if (tty) == "/dev/tty1" {
echo "Hello, World"
}
'';
shellAliases = {
"lsname" = "(ls | get name)";
"ll" = "ls -a";
};
environmentVariables = { BAR = "$'(echo BAZ)'"; };
};
test.stubs.nushell = { };
nmt.script = let
configDir = if pkgs.stdenv.isDarwin then
"home-files/Library/Application Support/nushell"
else
"home-files/.config/nushell";
in ''
assertFileContent \
"${configDir}/config.nu" \
${./config-expected.nu}
assertFileContent \
"${configDir}/env.nu" \
${./env-expected.nu}
assertFileContent \
"${configDir}/login.nu" \
${./login-expected.nu}
'';
}