os/shared/home/bash.nix

44 lines
No EOL
809 B
Nix

# Configuration of the shell.
# TODO: switch to a shell from this century
{ pkgs, lib, config, ... }:
let cfg = config.custom.bash;
in with lib; {
options.custom.bash = with types; {
extraAliases = mkOption {
default = {};
};
};
config = {
# Configure the shell itself
programs.bash = {
enable = true;
shellAliases = {
":q" = "exit";
"t" = "exa -T";
} // cfg.extraAliases;
};
# Configure the prompt
programs.starship = {
enable = true;
settings = {
format = ''
$directory$git_branch$cmd_duration$sudo
$character
'';
character = {
success_symbol = "[>](bold green)";
error_symbol = "[](bold red)";
};
};
};
};
}