137 lines
3.1 KiB
Nix
137 lines
3.1 KiB
Nix
{ pkgs, ... }: {
|
|
home.sessionVariables = {
|
|
EDITOR = "hx";
|
|
USER = "lu";
|
|
SHELL = pkgs.fish;
|
|
TERM = "xterm-256color";
|
|
};
|
|
|
|
programs.fish = {
|
|
enable = true;
|
|
|
|
functions = { setpath = "test -e $argv[1]; and fish_add_path $argv[1]"; };
|
|
|
|
interactiveShellInit = ''
|
|
setpath /opt/local/bin
|
|
setpath /opt/homebrew/bin
|
|
setpath ~/.cargo/bin
|
|
setpath ~/.ghcup/bin
|
|
setpath ~/.cabal/bin
|
|
setpath ~/.local/bin
|
|
setpath ~/.bun/bin
|
|
setpath ~/.config/emacs/bin
|
|
'';
|
|
|
|
shellAliases = {
|
|
# General aliases
|
|
cl = "clear";
|
|
ll = "ls -lahF --color=always";
|
|
e = "$EDITOR";
|
|
se = "sudoedit";
|
|
"cd.." = "cd ../";
|
|
rmrf = "rm -rf";
|
|
|
|
# overrides of defaults
|
|
mkdir = "mkdir -p";
|
|
cp = "cp -r";
|
|
scp = "scp -r";
|
|
apt = "sudo apt";
|
|
docker = "sudo docker";
|
|
sctl = "sudo systemctl";
|
|
usctl = "systemctl --user";
|
|
doco = "sudo docker-compose";
|
|
|
|
# z is a weird key to hit frequently, j is much better
|
|
j = "z";
|
|
|
|
# cargoes and rust-s
|
|
c = "cargo";
|
|
cr = "cargo run";
|
|
cb = "cargo build";
|
|
ct = "cargo test";
|
|
cwr = "cargo watch -x run";
|
|
|
|
# rubies
|
|
be = "bundle exec";
|
|
|
|
# cd into a temp directory, very useful!
|
|
mkt = "cd (mktemp -d)";
|
|
|
|
# tmux aliases
|
|
tx = "tmux";
|
|
txls = "tmux list-sessions";
|
|
txa = "tmux attach";
|
|
|
|
# git aliases
|
|
lg = "lazygit";
|
|
g = "git";
|
|
ga = "git add";
|
|
gs = "git status --short";
|
|
gl = "git log --color --graph --abbrev-commit --oneline";
|
|
gqp = "git add --all; and git commit; and git push";
|
|
gqc = "git add --all; and git commit";
|
|
gpl = "git pull";
|
|
gps = "git push";
|
|
gc = "git commit";
|
|
gb = "git branch";
|
|
gaa = "git add --all";
|
|
gco = "git checkout";
|
|
editorigin = "git remote set-url origin";
|
|
|
|
# jj aliases
|
|
jst = "jj st";
|
|
jd = "jj describe";
|
|
jl = "jj log";
|
|
jprev = "jj edit @-";
|
|
jnext = "jj edit @+";
|
|
jbm = "jj branch move";
|
|
jgp = "jj git push";
|
|
jdiff = "jj diff";
|
|
jnew = "jj new";
|
|
|
|
# nix aliases
|
|
n = "nix";
|
|
nd = "nix develop";
|
|
ns = "nix shell";
|
|
np = "nix profile";
|
|
ngc = "nh clean all --keep 3";
|
|
rebuild = "nh os switch";
|
|
};
|
|
|
|
plugins = [
|
|
{
|
|
name = "done";
|
|
src = pkgs.fishPlugins.done.src;
|
|
}
|
|
{
|
|
name = "pisces";
|
|
src = pkgs.fishPlugins.pisces.src;
|
|
}
|
|
{
|
|
name = "plugin-foreign-env";
|
|
src = pkgs.fetchFromGitHub {
|
|
owner = "oh-my-fish";
|
|
repo = "plugin-foreign-env";
|
|
rev = "7f0cf099ae1e1e4ab38f46350ed6757d54471de7";
|
|
sha256 = "0d16mdgjdwln41zk44qa5vcilmlia4w15r8z2rc3p49i5ankksg3";
|
|
};
|
|
}
|
|
];
|
|
};
|
|
|
|
programs.starship = {
|
|
enable = true;
|
|
enableFishIntegration = true;
|
|
settings = {
|
|
character = {
|
|
success_symbol = "[~](green)";
|
|
error_symbol = "[~](red)";
|
|
};
|
|
};
|
|
};
|
|
|
|
programs.zoxide = {
|
|
enable = true;
|
|
enableFishIntegration = true;
|
|
};
|
|
}
|