2024-10-28 01:55:30 +00:00
|
|
|
{ lib, writeTextDir, buildEnv, extendedStdenv, direnv, coreutils }:
|
2024-10-26 11:29:58 +00:00
|
|
|
|
2024-10-26 11:35:54 +00:00
|
|
|
{ paths ? [ ], pathsToLink ? [ ], ... }@args:
|
2024-10-26 11:29:58 +00:00
|
|
|
|
2024-10-28 01:55:30 +00:00
|
|
|
let
|
|
|
|
bashProfile = writeTextDir "/etc/bashrc" ''
|
|
|
|
# This should only be applied to interactive shells.
|
|
|
|
[[ $- == *i* ]] || return
|
|
|
|
|
|
|
|
if [[ -n "$PS1" ]]; then
|
|
|
|
shopt -s checkwinsize
|
|
|
|
set +h
|
|
|
|
|
|
|
|
PS1="\h $ "
|
|
|
|
|
|
|
|
eval "$(${lib.getExe' direnv "direnv"} hook bash)"
|
|
|
|
eval "$(${lib.getExe' coreutils "dircolors"} --sh)"
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
in buildEnv (args // {
|
|
|
|
paths = extendedStdenv ++ paths ++ [ bashProfile ];
|
2024-10-26 11:35:54 +00:00
|
|
|
pathsToLink = [ "/bin" "/etc" "/share" "/lib" "/libexec" ] ++ pathsToLink;
|
2024-10-26 11:29:58 +00:00
|
|
|
})
|