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.
This commit is contained in:
SaiProton 2023-03-20 17:07:24 -04:00 committed by Robert Helgesson
parent 24805d3ca7
commit e15010ee6e
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
3 changed files with 46 additions and 0 deletions

View file

@ -16,6 +16,13 @@
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";
@ -38,5 +45,8 @@
assertFileContent \
"${configDir}/env.nu" \
${./env-expected.nu}
assertFileContent \
"${configDir}/login.nu" \
${./login-expected.nu}
'';
}

View file

@ -0,0 +1,5 @@
# Prints "Hello, World" upon logging into tty1
if (tty) == "/dev/tty1" {
echo "Hello, World"
}