2022-11-24 00:37:08 +01:00
|
|
|
{ pkgs, ... }:
|
2022-05-13 17:20:42 +02:00
|
|
|
|
|
|
|
{
|
|
|
|
programs.nushell = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
configFile.text = ''
|
|
|
|
let $config = {
|
|
|
|
filesize_metric: false
|
|
|
|
table_mode: rounded
|
|
|
|
use_ls_colors: true
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
|
|
|
|
envFile.text = ''
|
2023-08-01 19:27:30 +02:00
|
|
|
$env.FOO = 'BAR'
|
2022-05-13 17:20:42 +02:00
|
|
|
'';
|
2022-12-27 17:29:16 +01:00
|
|
|
|
2023-03-20 22:07:24 +01:00
|
|
|
loginFile.text = ''
|
|
|
|
# Prints "Hello, World" upon logging into tty1
|
|
|
|
if (tty) == "/dev/tty1" {
|
|
|
|
echo "Hello, World"
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
|
2022-12-27 17:29:16 +01:00
|
|
|
shellAliases = {
|
|
|
|
"lsname" = "(ls | get name)";
|
|
|
|
"ll" = "ls -a";
|
|
|
|
};
|
2023-05-04 00:12:21 +02:00
|
|
|
|
|
|
|
environmentVariables = { BAR = "$'(echo BAZ)'"; };
|
2022-05-13 17:20:42 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
test.stubs.nushell = { };
|
|
|
|
|
2022-11-24 00:37:08 +01:00
|
|
|
nmt.script = let
|
|
|
|
configDir = if pkgs.stdenv.isDarwin then
|
|
|
|
"home-files/Library/Application Support/nushell"
|
|
|
|
else
|
|
|
|
"home-files/.config/nushell";
|
|
|
|
in ''
|
2022-05-13 17:20:42 +02:00
|
|
|
assertFileContent \
|
2022-11-24 00:37:08 +01:00
|
|
|
"${configDir}/config.nu" \
|
2022-05-13 17:20:42 +02:00
|
|
|
${./config-expected.nu}
|
|
|
|
assertFileContent \
|
2022-11-24 00:37:08 +01:00
|
|
|
"${configDir}/env.nu" \
|
2022-05-13 17:20:42 +02:00
|
|
|
${./env-expected.nu}
|
2023-03-20 22:07:24 +01:00
|
|
|
assertFileContent \
|
|
|
|
"${configDir}/login.nu" \
|
|
|
|
${./login-expected.nu}
|
2022-05-13 17:20:42 +02:00
|
|
|
'';
|
|
|
|
}
|