nixdots/home/programs/terminal/shell/zsh/aliases.nix

40 lines
863 B
Nix
Raw Permalink Normal View History

2024-04-12 22:28:25 +00:00
{ config, pkgs, lib, ... }:
2024-03-23 23:44:57 +00:00
let
2024-04-12 22:28:25 +00:00
nr = "${pkgs.nixos-rebuild}/bin/nixos-rebuild";
2024-03-23 23:44:57 +00:00
in
{
2024-03-24 12:18:51 +00:00
programs.zsh.shellAliases = {
# I'm not the greatest typist
sl = "ls";
mdkir = "mkdir";
soruce = "source";
suod = "sudo";
sduo = "sudo";
2024-03-23 23:44:57 +00:00
2024-03-24 12:18:51 +00:00
# Directory changing
".." = "cd ..";
"..." = "cd ../../";
"...." = "cd ../../../";
"....." = "cd ../../../../";
".2" = "cd ../../";
".3" = "cd ../../../";
".4" = "cd ../../../../";
".5" = "cd ../../../../../";
2024-03-23 23:44:57 +00:00
2024-03-24 12:18:51 +00:00
# Files/Directories utilities
mkdir = "mkdir -p";
md = "mkdir";
fhere = "find . -name";
rr = "rm -r";
rf = "rm -f";
rrf = "rm -rf";
vimdiff = "nvim -d";
2024-03-23 23:44:57 +00:00
2024-04-12 22:28:25 +00:00
# Nix aliases
rebuild = "nix-store --verify; pushd ~/dots; ${nr} switch --flake .#$1 --use-remote-sudo ; popd";
2024-03-24 12:18:51 +00:00
# Expand aliases from sudo
sudo = "sudo ";
2024-03-23 23:44:57 +00:00
};
}