2024-06-30 03:56:48 +03:00
|
|
|
{ util, pkgs, ... } @args: let
|
|
|
|
modules = util.catText (util.ls ./module) args;
|
|
|
|
modulesFile = pkgs.writeText "BashModules" modules;
|
|
|
|
in {
|
|
|
|
inherit modules modulesFile;
|
|
|
|
|
|
|
|
bashrc = modules + util.trimTabs ''
|
|
|
|
# Find all functions.
|
|
|
|
function find_function() {
|
|
|
|
/usr/bin/env cat ${modulesFile} | /usr/bin/env grep "^function.*()" | /usr/bin/env sed -e "s/^function //" -e "s/().*//"
|
|
|
|
}
|
|
|
|
|
|
|
|
# Export all functions.
|
|
|
|
export -f $(find_function | tr '\n' ' ')
|
|
|
|
export -f find_function
|
|
|
|
|
|
|
|
# Autostart Sway.
|
|
|
|
if [[ -z $DISPLAY ]] && [[ "$(tty)" = "/dev/tty1" ]]; then
|
|
|
|
exec sway
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
2024-07-01 08:15:31 +03:00
|
|
|
# bash_profile = util.trimTabs ''
|
|
|
|
# # Home manager.
|
|
|
|
# [ -e ~/.nix-profile/etc/profile.d/nix.sh ] && source ~/.nix-profile/etc/profile.d/nix.sh
|
2024-06-30 03:56:48 +03:00
|
|
|
|
2024-07-01 08:15:31 +03:00
|
|
|
# # Bashrc.
|
|
|
|
# [ -f ~/.bashrc ] && source ~/.bashrc
|
2024-06-30 03:56:48 +03:00
|
|
|
|
2024-07-01 08:15:31 +03:00
|
|
|
# # Profile.
|
|
|
|
# [ -f ~/.profile ] && source ~/.profile
|
|
|
|
# '';
|
2024-06-30 03:56:48 +03:00
|
|
|
|
2024-07-01 08:15:31 +03:00
|
|
|
# profile = util.trimTabs ''
|
|
|
|
# # Load HM vars.
|
|
|
|
# [ -e ~/.nix-profile/etc/profile.d/hm-session-vars.sh ] && source ~/.nix-profile/etc/profile.d/hm-session-vars.sh
|
|
|
|
# '';
|
2024-06-30 03:56:48 +03:00
|
|
|
}
|