From f5243bb25cc0fc2dc934544289d790d752e42bf0 Mon Sep 17 00:00:00 2001 From: Frost-Phoenix <67cyril6767@gmail.com> Date: Sun, 5 Nov 2023 21:47:04 +0100 Subject: [PATCH] add shell alias --- modules/home/git/default.nix | 21 +++++++++++++++++++++ modules/home/package/default.nix | 2 ++ modules/home/zsh/default.nix | 24 ++++++++++++++++-------- 3 files changed, 39 insertions(+), 8 deletions(-) diff --git a/modules/home/git/default.nix b/modules/home/git/default.nix index 1dd5b8f..6b684ab 100644 --- a/modules/home/git/default.nix +++ b/modules/home/git/default.nix @@ -10,6 +10,27 @@ init.defaultBranch = "main"; credential.helper = "store"; }; + + environment.shellAliases = { + # Git aliases + ga = "git add"; + gaa = "git add --all"; + gs = "git status"; + gb = "git branch"; + gm = "git merge"; + gpl = "git pull"; + gplo = "git pull origin"; + gps = "git push"; + gpso = "git push origin"; + gc = "git commit"; + gcm = "git commit -m"; + gch = "git checkout"; + gchb = "git checkout -b"; + gcoe = "git config user.email"; + gcon = "git config user.name"; + + g = "lazygit"; + }; }; home.packages = [ pkgs.gh ]; diff --git a/modules/home/package/default.nix b/modules/home/package/default.nix index e2721aa..a6e49dc 100755 --- a/modules/home/package/default.nix +++ b/modules/home/package/default.nix @@ -18,6 +18,8 @@ rustup php vscode + lazygit + bat # others openssl diff --git a/modules/home/zsh/default.nix b/modules/home/zsh/default.nix index 52d99d7..709068d 100755 --- a/modules/home/zsh/default.nix +++ b/modules/home/zsh/default.nix @@ -11,16 +11,24 @@ }; shellAliases = { - n = "clear && neofetch"; - v = "nvim"; - record = "wf-recorder --audio=alsa_output.pci-0000_08_00.6.analog-stereo.monitor -f $HOME/Videos/$(date +'%Y%m%d%H%M%S_1.mp4')"; - ani = "bash $HOME/.local/bin/anime --dub"; - ls = "exa --icons --long"; + # record = "wf-recorder --audio=alsa_output.pci-0000_08_00.6.analog-stereo.monitor -f $HOME/Videos/$(date +'%Y%m%d%H%M%S_1.mp4')"; + # ani = "bash $HOME/.local/bin/anime --dub"; + + vim = "nvim"; + cat = "bat --theme 'Visual Studio Dark+'"; + l = "eza --icons -a --group-directories-first -1"; #EZA_ICON_SPACING=2 + ll = "eza --icons -a --group-directories-first -1 --no-user --long"; + tree = "eza --icons --tree --group-directories-first"; + findw = "grep -rl"; # nixos - ncg = "nix-collect-garbage && nix-collect-garbage -d && sudo nix-collect-garbage && sudo nix-collect-garbage -d && sudo rm /nix/var/nix/gcroots/auto/*"; - nix-switch = "sudo nixos-rebuild switch --flake ~/Flakes/.#nixos"; - fl = "cd ~/Flakes/ && v"; + nix-switch = "sudo nixos-rebuild switch --flake nixos-config#nixos"; + nix-switchu = "sudo nixos-rebuild switch --upgrade --flake nixos-config#nixos"; + nix-flake-update = "sudo nix flake update nixos-config#"; + nix-clean = "nix-collect-garbage && nix-collect-garbage -d && sudo nix-collect-garbage && sudo nix-collect-garbage -d && sudo rm /nix/var/nix/gcroots/auto/*"; + # nix-clean = "sudo nix-collect-garbage -d"; + # nix-cleanold = "sudo nix-collect-garbage --delete-old"; + # nix-cleanboot = "sudo /run/current-system/bin/switch-to-configuration boot"; # python piv = "python -m venv .venv";