mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-07-10 14:42:40 +02:00
fix: skip load alias_for_work if it does not exist
This commit is contained in:
@@ -3,12 +3,21 @@
|
|||||||
programs.bash = {
|
programs.bash = {
|
||||||
# load the alias file for work
|
# load the alias file for work
|
||||||
bashrcExtra = ''
|
bashrcExtra = ''
|
||||||
source /etc/agenix/alias-for-work.bash
|
alias_for_work=/etc/agenix/alias-for-work.bash
|
||||||
|
if [ -f $alias_for_work ]; then
|
||||||
|
. $alias_for_work
|
||||||
|
else
|
||||||
|
echo "No alias file found for work"
|
||||||
|
fi
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.nushell = {
|
programs.nushell = {
|
||||||
# load the alias file for work
|
# load the alias file for work
|
||||||
|
# the file must exist, otherwise nushell will complain about it!
|
||||||
|
#
|
||||||
|
# currently, nushell does not support conditional sourcing of files
|
||||||
|
# https://github.com/nushell/nushell/issues/8214
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
source /etc/agenix/alias-for-work.nushell
|
source /etc/agenix/alias-for-work.nushell
|
||||||
'';
|
'';
|
||||||
|
|||||||
Reference in New Issue
Block a user