mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-04-24 12:19:12 +00:00
profiles/dev: update dev.shells to add Bash as preferred shell
This commit is contained in:
parent
c714ef7237
commit
91b31d6d30
@ -32,6 +32,47 @@ in {
|
||||
})
|
||||
|
||||
(lib.mkIf cfg.shell.enable {
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
historyControl = [ "ignoredups" "ignorespace" ];
|
||||
historyIgnore = [
|
||||
"cd"
|
||||
"exit"
|
||||
"lf"
|
||||
"ls"
|
||||
"nvim"
|
||||
];
|
||||
bashrcExtra = ''
|
||||
function f() {
|
||||
dir=''${1:-$PWD}
|
||||
dest=$(${pkgs.fd}/bin/fd --type directory --hidden --ignore-vcs --base-directory "$dir" \
|
||||
| ${pkgs.fzf}/bin/fzf --prompt "Go to directory ")
|
||||
destPrime=$(${pkgs.coreutils}/bin/realpath --canonicalize-existing --logical "$dir/$dest")
|
||||
|
||||
cd "$destPrime"
|
||||
}
|
||||
|
||||
function ff() {
|
||||
dir=''${1:-$PWD}
|
||||
dest=$(${pkgs.fd}/bin/fd --hidden --ignore-vcs --base-directory "$dir" \
|
||||
| ${pkgs.fzf}/bin/fzf --prompt "Open file ")
|
||||
destPrime=$(${pkgs.coreutils}/bin/realpath --canonicalize-existing --logical "$dir/$dest")
|
||||
|
||||
if [ -d "$destPrime" ]; then
|
||||
cd "$destPrime";
|
||||
else
|
||||
${pkgs.xdg-utils}/bin/xdg-open "$destPrime";
|
||||
fi
|
||||
}
|
||||
|
||||
function fm() {
|
||||
${pkgs.man}/bin/man -k . \
|
||||
| ${pkgs.fzf}/bin/fzf --multi --prompt "Open manpage(s) " \
|
||||
| ${pkgs.gawk}/bin/awk '{ print $1 "." gensub(/[()]/, "", "g", $2) }' \
|
||||
| ${pkgs.findutils}/bin/xargs man
|
||||
}
|
||||
'';
|
||||
};
|
||||
programs.atuin.enable = true;
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
|
Loading…
Reference in New Issue
Block a user