2022-05-06 13:29:25 +00:00
|
|
|
{ config, pkgs, lib, ... }: {
|
2022-04-29 01:40:21 +00:00
|
|
|
|
2022-05-06 03:01:56 +00:00
|
|
|
users.users.${config.user}.shell = pkgs.fish;
|
2022-04-29 01:56:21 +00:00
|
|
|
|
2022-05-06 03:01:56 +00:00
|
|
|
home-manager.users.${config.user} = {
|
2022-04-30 15:08:16 +00:00
|
|
|
|
2022-05-06 13:29:25 +00:00
|
|
|
home.packages = with pkgs; [ exa fd bat ripgrep curl ];
|
2022-04-30 15:08:16 +00:00
|
|
|
|
2022-04-29 01:40:21 +00:00
|
|
|
programs.fish = {
|
|
|
|
enable = true;
|
2022-04-30 14:21:43 +00:00
|
|
|
functions = {
|
|
|
|
commandline-git-commits = {
|
|
|
|
description = "Insert commit into commandline";
|
2022-05-06 13:44:21 +00:00
|
|
|
body = builtins.readFile ./functions/commandline-git-commits.fish;
|
2022-04-30 14:21:43 +00:00
|
|
|
};
|
|
|
|
copy = {
|
|
|
|
description = "Copy file contents into clipboard";
|
|
|
|
body = "cat $argv | pbcopy"; # Need to fix for non-macOS
|
|
|
|
};
|
|
|
|
edit = {
|
|
|
|
description = "Open a file in Vim";
|
2022-05-06 13:44:21 +00:00
|
|
|
body = builtins.readFile ./functions/edit.fish;
|
2022-04-30 14:21:43 +00:00
|
|
|
};
|
|
|
|
envs = {
|
|
|
|
description = "Evaluate a bash-like environment variables file";
|
|
|
|
body = ''set -gx (cat $argv | tr "=" " " | string split ' ')'';
|
|
|
|
};
|
|
|
|
fcd = {
|
|
|
|
description = "Jump to directory";
|
|
|
|
argumentNames = "directory";
|
2022-05-06 13:44:21 +00:00
|
|
|
body = builtins.readFile ./functions/fcd.fish;
|
2022-04-30 14:21:43 +00:00
|
|
|
};
|
|
|
|
fish_user_key_bindings = {
|
2022-05-06 13:44:21 +00:00
|
|
|
body = builtins.readFile ./functions/fish_user_key_bindings.fish;
|
2022-04-30 14:21:43 +00:00
|
|
|
};
|
2022-05-06 13:44:21 +00:00
|
|
|
ip = { body = builtins.readFile ./functions/ip.fish; };
|
2022-04-30 14:21:43 +00:00
|
|
|
json = {
|
|
|
|
description = "Tidy up JSON using jq";
|
|
|
|
body = "pbpaste | jq '.' | pbcopy"; # Need to fix for non-macOS
|
|
|
|
};
|
2022-04-30 15:08:16 +00:00
|
|
|
ls = { body = "exa $argv"; };
|
2022-04-30 14:21:43 +00:00
|
|
|
note = {
|
|
|
|
description = "Edit or create a note";
|
|
|
|
argumentNames = "filename";
|
2022-05-06 13:44:21 +00:00
|
|
|
body = builtins.readFile ./functions/note.fish;
|
2022-04-30 14:21:43 +00:00
|
|
|
};
|
|
|
|
recent = {
|
|
|
|
description = "Open a recent file in Vim";
|
2022-05-06 13:44:21 +00:00
|
|
|
body = builtins.readFile ./functions/recent.fish;
|
2022-04-30 14:21:43 +00:00
|
|
|
};
|
|
|
|
syncnotes = {
|
|
|
|
description = "Full git commit on notes";
|
2022-05-06 13:44:21 +00:00
|
|
|
body = builtins.readFile ./functions/syncnotes.fish;
|
2022-04-30 14:21:43 +00:00
|
|
|
};
|
|
|
|
};
|
2022-04-30 15:08:16 +00:00
|
|
|
interactiveShellInit = ''
|
|
|
|
bind yy fish_clipboard_copy
|
|
|
|
bind Y fish_clipboard_copy
|
|
|
|
bind -M visual y fish_clipboard_copy
|
|
|
|
bind p fish_clipboard_paste
|
|
|
|
set -g fish_vi_force_cursor
|
|
|
|
set -g fish_cursor_default block
|
|
|
|
set -g fish_cursor_insert line
|
|
|
|
set -g fish_cursor_visual block
|
|
|
|
set -g fish_cursor_replace_one underscore
|
|
|
|
'';
|
2022-04-29 01:40:21 +00:00
|
|
|
loginShellInit = "";
|
2022-04-30 15:08:16 +00:00
|
|
|
shellAliases = { };
|
2022-04-29 01:40:21 +00:00
|
|
|
shellAbbrs = {
|
|
|
|
|
|
|
|
# Directory aliases
|
2022-05-06 12:58:44 +00:00
|
|
|
l = "ls -lh";
|
2022-04-29 01:40:21 +00:00
|
|
|
lh = "ls -lh";
|
|
|
|
ll = "ls -alhF";
|
|
|
|
la = "ls -a";
|
|
|
|
c = "cd";
|
|
|
|
"-" = "cd -";
|
|
|
|
mkd = "mkdir -pv";
|
|
|
|
|
|
|
|
# System
|
|
|
|
s = "sudo";
|
|
|
|
sc = "systemctl";
|
|
|
|
scs = "systemctl status";
|
2022-05-06 13:29:25 +00:00
|
|
|
m = "make";
|
2022-04-29 01:40:21 +00:00
|
|
|
|
|
|
|
# Tmux
|
|
|
|
ta = "tmux attach-session";
|
|
|
|
tan = "tmux attach-session -t noah";
|
|
|
|
tnn = "tmux new-session -s noah";
|
|
|
|
|
|
|
|
# Vim
|
|
|
|
v = "vim";
|
|
|
|
vl = "vim -c 'normal! `0'";
|
|
|
|
|
|
|
|
# Notes
|
|
|
|
sn = "syncnotes";
|
|
|
|
|
|
|
|
# Fun CLI Tools
|
|
|
|
weather = "curl wttr.in/$WEATHER_CITY";
|
|
|
|
moon = "curl wttr.in/Moon";
|
|
|
|
|
|
|
|
# Cheat Sheets
|
|
|
|
ssl =
|
|
|
|
"openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr";
|
|
|
|
fingerprint = "ssh-keyscan myhost.com | ssh-keygen -lf -";
|
|
|
|
publickey = "ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub";
|
|
|
|
forloop = "for i in (seq 1 100)";
|
|
|
|
|
|
|
|
# Docker
|
|
|
|
dc = "$DOTS/bin/docker_cleanup";
|
|
|
|
dr = "docker run --rm -it";
|
|
|
|
db = "docker build . -t";
|
|
|
|
|
|
|
|
# Terraform
|
|
|
|
te = "terraform";
|
|
|
|
|
|
|
|
# Kubernetes
|
|
|
|
k = "kubectl";
|
|
|
|
pods = "kubectl get pods -A";
|
|
|
|
nodes = "kubectl get nodes";
|
|
|
|
deploys = "kubectl get deployments -A";
|
|
|
|
dash = "kube-dashboard";
|
|
|
|
ks = "k9s";
|
|
|
|
|
|
|
|
# Python
|
|
|
|
py = "python";
|
|
|
|
po = "poetry";
|
|
|
|
pr = "poetry run python";
|
|
|
|
|
|
|
|
# Rust
|
|
|
|
ca = "cargo";
|
|
|
|
|
|
|
|
};
|
|
|
|
shellInit = "";
|
2022-04-28 22:55:15 +00:00
|
|
|
};
|
|
|
|
|
2022-05-06 13:29:25 +00:00
|
|
|
home.sessionVariables.fish_greeting = "";
|
2022-04-28 23:11:33 +00:00
|
|
|
|
2022-05-06 13:29:25 +00:00
|
|
|
programs.starship.enableFishIntegration = true;
|
|
|
|
programs.zoxide.enableFishIntegration = true;
|
|
|
|
programs.fzf.enableFishIntegration = true;
|
2022-04-30 15:08:16 +00:00
|
|
|
|
2022-05-09 00:49:42 +00:00
|
|
|
# Provides "command-not-found" options
|
|
|
|
# Requires activating a manual download
|
|
|
|
programs.nix-index = {
|
|
|
|
enable = true;
|
|
|
|
enableFishIntegration = true;
|
|
|
|
};
|
|
|
|
|
2022-04-28 23:11:33 +00:00
|
|
|
};
|
2022-04-28 22:55:15 +00:00
|
|
|
}
|