From 6ffb65fbc0afa4c1adcebf44c88ce8105b28b097 Mon Sep 17 00:00:00 2001 From: Menno van Leeuwen Date: Wed, 22 Jan 2025 16:15:06 +0100 Subject: [PATCH] refactor: update Home Manager and Ansible commands to use HOSTNAME variable --- .bashrc | 5 ----- bin/actions/update.sh | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.bashrc b/.bashrc index dbb900f..0eea4ce 100644 --- a/.bashrc +++ b/.bashrc @@ -6,11 +6,6 @@ HISTFILESIZE=2000 # Adjusted to match both histfile and size criteria # Docker Compose Alias (Mostly for old shell scripts) alias docker-compose='docker compose' -# Home Manager Configuration -alias hm='cd $HOME/dotfiles/config/home-manager/ && home-manager' -alias hmnews='hm news --flake .#$DOTF_HOSTNAME' -alias hmup='hm switch --flake .#$DOTF_HOSTNAME --impure' - # Modern tools aliases alias l="eza --header --long --git --group-directories-first --group --icons --color=always --sort=name --hyperlink -o --no-permissions" alias ll='l' diff --git a/bin/actions/update.sh b/bin/actions/update.sh index b85ecc2..0e63a9c 100755 --- a/bin/actions/update.sh +++ b/bin/actions/update.sh @@ -52,7 +52,7 @@ if [[ "$RUN_HA" == true ]]; then rm -rf $HOME/.config/mimeapps.list.backup printfe "%s\n" "cyan" "Upgrading Home Manager packages..." - cd $HOME/dotfiles/config/home-manager && NIXPKGS_ALLOW_UNFREE=1 home-manager --extra-experimental-features nix-command --extra-experimental-features flakes switch -b backup --flake .#$DOTF_HOSTNAME --impure --cores $CORES -j $JOBS + cd $HOME/dotfiles/config/home-manager && NIXPKGS_ALLOW_UNFREE=1 home-manager --extra-experimental-features nix-command --extra-experimental-features flakes switch -b backup --flake .#$HOSTNAME --impure --cores $CORES -j $JOBS if [[ $? -ne 0 ]]; then printfe "%s\n" "red" "Failed to upgrade Home Manager packages." @@ -76,7 +76,7 @@ if [[ "$RUN_ANSIBLE" == true ]]; then fi printfe "%s\n" "cyan" "Running Ansible playbook..." - cd $HOME/dotfiles/config/ansible && ansible-playbook -i $HOME/dotfiles/config/ansible/inventory.ini $HOME/dotfiles/config/ansible/main.yml --extra-vars "hostname=$DOTF_HOSTNAME" --extra-vars "ansible_user=$USER" --limit $DOTF_HOSTNAME --ask-become-pass + cd $HOME/dotfiles/config/ansible && ansible-playbook -i $HOME/dotfiles/config/ansible/inventory.ini $HOME/dotfiles/config/ansible/main.yml --extra-vars "hostname=$HOSTNAME" --extra-vars "ansible_user=$USER" --limit $HOSTNAME --ask-become-pass if [[ $? -ne 0 ]]; then printfe "%s\n" "red" "Failed to upgrade Ansible packages."