diff --git a/programs/shell/default.nix b/programs/shell/default.nix index dbf715d..8470d1b 100644 --- a/programs/shell/default.nix +++ b/programs/shell/default.nix @@ -70,10 +70,6 @@ "EDITOR" = "emacs -nw"; "VISUAL" = "emacs"; }; - shellAliases = { - nixos-switch = "sudo nixos-rebuild switch --flake flake:my-nixos --show-trace"; - home-manager-switch = "nix run flake:my-home-manager -- switch --flake flake:my-home-manager --show-trace"; - }; initExtra = '' ## completion config and styling zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' diff --git a/scripts/default.nix b/scripts/default.nix index 2a53469..d0ec350 100644 --- a/scripts/default.nix +++ b/scripts/default.nix @@ -1,5 +1,7 @@ {pkgs, ...}: { home.packages = [ + (pkgs.writeShellScriptBin "system-update-all" + (builtins.readFile ./shell/system-update-all.sh)) (pkgs.writeShellScriptBin "git-sync-all" (builtins.readFile ./shell/git-sync-all.sh)) (pkgs.writeShellScriptBin "rsync-local-config" diff --git a/scripts/shell/system-update-all.sh b/scripts/shell/system-update-all.sh new file mode 100644 index 0000000..fac7392 --- /dev/null +++ b/scripts/shell/system-update-all.sh @@ -0,0 +1,14 @@ +NIXOS_CONFIGURATION="/etc/nixos" +HOME_MANAGER_CONFIGURATION="$HOME/.config/home-manager" + +( + cd "$NIXOS_CONFIGURATION" || exit 1 + git pull --ff --ff-only || exit 1 + sudo nixos-rebuild switch +) + +( + cd "$HOME_MANAGER_CONFIGURATION" || exit 1 + git pull --ff --ff-only || exit 1 + home-manager switch +)