{ lib, pkgs, pkgsStable, this, ... }: with lib; { hm = { programs = { bash = { enable = true; shellOptions = [ "autocd" "cdspell" "checkjobs" "checkwinsize" "dirspell" "extglob" "globstar" "histappend" "histreedit" "histverify" ]; profileExtra = '' export _PROFILE_SOURCED=1 ''; initExtra = '' set -o notify if [ "$TERM" != "dumb" ] || [ -n "$INSIDE_EMACS" ]; then PROMPT_COLOR="1;31m" ((UID)) && PROMPT_COLOR="1;32m" if [ -n "$INSIDE_EMACS" ] || [ "$TERM" = "eterm" ] || [ "$TERM" = "eterm-color" ]; then PS1="\n\[\033[$PROMPT_COLOR\][\u@\h:\w]\\$\[\033[0m\] " else PS1="\n\[\033[$PROMPT_COLOR\][\[\e]0;\u@\h: \w\a\]\u@\h:\w]\\$\[\033[0m\] " fi if test "$TERM" = "xterm"; then PS1="\[\033]2;\h:\u:\w\007\]$PS1" fi fi ${readFile ./functions.bash} GRC_ALIASES=true source ${pkgs.grc}/etc/profile.d/grc.sh if [ -z "$_PROFILE_SOURCED" ] && [ -f "$HOME/.profile" ]; then source "$HOME/.profile" fi ''; shellAliases = listToAttrs (map ({ name, value, }: nameValuePair name (with pkgs; let pkg = if this.isHeadful then # FIXME Update this to 9.3 when patches[1] become available # # [1]: https://github.com/jarun/advcpmv (pkgsStable.coreutils.overrideAttrs (_: _: { patches = [ (fetchpatch { url = "https://raw.githubusercontent.com/jarun/advcpmv/ea268d870b475edd5960dcd55d5378abc9705958/advcpmv-0.9-9.1.patch"; hash = "sha256-d+SRT/R4xmfHLAdOr7m4R3WFiW64P5ZH6iqDvErYCyg="; }) ]; })) else coreutils; in "${pkg}/bin/coreutils --coreutils-prog=${value}")) ( let mkAlias = { name ? head command, command, }: { inherit name; value = concatStringsSep " " command; }; progressBar = optionalString this.isHeadful "--progress-bar"; in [ (mkAlias {command = ["cp" "--interactive" "--recursive" progressBar];}) (mkAlias {command = ["mv" "--interactive" progressBar];}) (mkAlias {command = ["rm" "--interactive=once"];}) (mkAlias {command = ["ln" "--interactive"];}) (mkAlias {command = ["mkdir" "--parents"];}) (mkAlias {command = ["rmdir" "--parents"];}) (mkAlias { name = "lower"; command = ["tr" "'[:upper:]'" "'[:lower:]'"]; }) (mkAlias { name = "upper"; command = ["tr" "'[:lower:]'" "'[:upper:]'"]; }) (mkAlias { name = "disk"; command = [ "df" "--human-readable" "--exclude-type=tmpfs" "--exclude-type=devtmpfs" "2>/dev/null" ]; }) ] )) // genAttrs ["grep" "egrep" "fgrep"] (name: "${pkgs.gnugrep}/bin/${name} --color=always"); historyControl = ["ignoredups" "ignorespace"]; }; command-not-found.enable = false; dircolors.enable = true; }; home.packages = with pkgs; [grc]; }; environment.systemPackages = with pkgs; [ bash-completion bc gawk hr moreutils pv ]; }