charles: add jq, fd, bat and manage zsh config via home-manager

This commit is contained in:
Payas Relekar 2023-10-26 12:42:34 +05:30
parent e6ffa662b8
commit bd159ea069
2 changed files with 118 additions and 1 deletions

View file

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ config, pkgs, ... }:
{
imports = [
@ -23,7 +23,20 @@
home = {
packages = with pkgs; [
rage
jq
fd
ripgrep
];
file = {
zsh = {
enable = true;
executable = false;
recursive = false;
source = ./zshrc;
target = "/Users/.zshrc";
};
};
};
programs = {
@ -64,5 +77,53 @@
};
};
};
bat.enable = true;
fzf = {
enable = true;
tmux.enableShellIntegration = true;
};
htop = {
enable = true;
settings = {
color_scheme = 6;
delay = 15;
fields = with config.lib.htop.fields; [
PID
USER
PERCENT_CPU
PERCENT_MEM
TIME
COMM
];
enable_mouse = 1;
highlight_deleted_exe = 1;
highlight_megabytes = 1;
highlight_threads = 1;
highlight_changes = 0;
highlight_changes_delay_secs = 5;
highlight_base_name = 1;
tree_view = 1;
tree_view_always_by_pid = 0;
cpu_count_from_one = 1;
show_cpu_usage = 1;
show_cpu_frequency = 1;
show_cpu_temperature = 1;
degree_fahrenheit = 0;
hide_function_bar = 0;
show_program_path = 0;
} // (with config.lib.htop; leftMeters [
(bar "LeftCPUs")
(bar "Memory")
(text "LoadAverage")
(text "Uptime")
]) // (with config.lib.htop; rightMeters [
(bar "RightCPUs")
(bar "Swap")
(text "Tasks")
(text "Systemd")
]);
};
};
}

56
hosts/charles/zshrc Normal file
View file

@ -0,0 +1,56 @@
alias l="ls -lah"
alias gw="./gradlew"
alias gg="gradle"
alias fdn="fd --no-ignore"
alias rgn="rg --no-ignore"
alias gst="git status"
alias gpr="git pull --rebase"
alias gsh="git stash"
alias gl="git last"
alias gd="git diff"
alias acs='aws configure sso'
alias rewardsUAT='aws ssm start-session --target i-05442e8716f8bcf2b'
alias scoreUAT='aws ssm start-session --target i-0b3067b52db56ea92'
alias bffUAT='aws ssm start-session --target i-0fc57d05ca9228b74'
alias cardApiUAT='aws ssm start-session --target i-0ce9f7a231bb77134'
alias cadenceUAT='aws ssm start-session --target i-03f29abfbd8b938be'
alias cardHostUAT='aws ssm start-session --target i-0582c9d4683f3ccbd'
alias connectUAT='aws ssm start-session --target i-0269a22d75f6ab4db'
alias shiftUAT='aws ssm start-session --target i-0b5f3d2210904938c'
alias oneNudgeUAT='aws ssm start-session --target i-04eb5fc17e5662286'
alias billingUAT='aws ssm start-session --target i-039bdb9d85e3fcd6d'
alias repaymentsUAT='aws ssm start-session --target i-02c151753bc78ecfc'
alias externalUAT='aws ssm start-session --target i-0bc060f8f7c0c8fb7'
alias upiconnect='aws ssm start-session --target i-068762720ba37db1d'
alias upihost='aws ssm start-session --target i-0b1a996047322fdc7'
alias upirest='aws ssm start-session --target i-01e2ce376ba71de32'
alias hostdbg="aws ssm start-session --target i-0b1a996047322fdc7 --document-name AWS-StartPortForwardingSession --parameters '{\"portNumber\":[\"5005\"],\"localPortNumber\":[\"5005\"]}'"
alias conndbg="aws ssm start-session --target i-068762720ba37db1d --document-name AWS-StartPortForwardingSession --parameters '{\"portNumber\":[\"5005\"],\"localPortNumber\":[\"5005\"]}'"
alias jc="cd ~/git/jcard/"
alias u="cd ~/git/upi"
alias hms="home-manager switch --flake ~/git/nixos --verbose"
function batf() { tail -f "$1" | bat --paging=never; }
export FZF_CTRL_T_OPTS="
--preview 'bat -n --color=always {}'
--bind 'ctrl-/:change-preview-window(down|hidden|)'"
export FZF_CTRL_R_OPTS="
--preview 'echo {}' --preview-window up:3:hidden:wrap
--bind 'ctrl-/:toggle-preview'
--bind 'ctrl-y:execute-silent(echo -n {2..} | pbcopy)+abort'
--color header:italic
--header 'Press CTRL-Y to copy command into clipboard'"
export FZF_ALT_C_OPTS="--preview 'tree -C {}'"
export bank=csb
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
export PATH="/usr/local/sbin:$PATH"
export PATH="/usr/local/opt/postgresql@12/bin:$PATH"
eval "$(starship init zsh)"
export PATH="/usr/local/opt/gradle@7/bin:$PATH"
export PATH="/usr/local/opt/gradle@7/bin:$PATH"