mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-07 06:19:00 +00:00
lib/builders/build-fds-env: add default Bash prompt
This commit is contained in:
parent
5b82d00975
commit
f1699cc337
@ -1,8 +1,23 @@
|
|||||||
{ buildEnv, extendedStdenv }:
|
{ lib, writeTextDir, buildEnv, extendedStdenv, direnv, coreutils }:
|
||||||
|
|
||||||
{ paths ? [ ], pathsToLink ? [ ], ... }@args:
|
{ paths ? [ ], pathsToLink ? [ ], ... }@args:
|
||||||
|
|
||||||
buildEnv (args // {
|
let
|
||||||
paths = extendedStdenv ++ paths;
|
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 ];
|
||||||
pathsToLink = [ "/bin" "/etc" "/share" "/lib" "/libexec" ] ++ pathsToLink;
|
pathsToLink = [ "/bin" "/etc" "/share" "/lib" "/libexec" ] ++ pathsToLink;
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user