From e112c9f5ee8315f162a3a09ddd86d41243826786 Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Mon, 6 Dec 2021 23:04:27 +0100 Subject: [PATCH] zsh: Add alias for rebuild-switch --- modules/programs/zsh/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/programs/zsh/default.nix b/modules/programs/zsh/default.nix index b633d28..f5f9663 100644 --- a/modules/programs/zsh/default.nix +++ b/modules/programs/zsh/default.nix @@ -21,7 +21,10 @@ in { home-manager.users."${config.ptw.system.singleUser}".programs.zsh = { enable = true; history.ignoreSpace = true; - shellAliases = { + shellAliases = let + home = "/home/${config.ptw.system.singleUser}/Development/Personal/nixos-config"; + nixosSwitch = "nixos-rebuild --flake .#${config.ptw.system.hostName} switch"; + in { ls = "ls --color=always"; ".." = "cd .."; "..." = "cd ../../"; @@ -33,6 +36,8 @@ in { gds = "git diff --staged"; c = "clear"; suspend = "systemctl suspend"; + nixos-rebuild-switch = "pushd; cd ${home}; sudo ${nixosSwitch}; popd"; + nixos-rebuild-switch-fast = "pushd; cd ${home}; sudo ${nixosSwitch} --fast; popd"; waifu2x = "flatpak run com.github.nihui.waifu2x-ncnn-vulkan"; };