refactor: simplify Home Manager installation process by removing redundant checks
All checks were successful
Nix Format Check / check-format (push) Successful in 38s

This commit is contained in:
2025-01-22 15:44:38 +01:00
parent 766c90a5ba
commit 4cad585fee

View File

@ -174,23 +174,8 @@ install_home_manager() {
fi
log_info "Installing Home Manager..."
if ! command -v nix-channel >/dev/null 2>&1; then
nix-channel --add "https://github.com/nix-community/home-manager/archive/release-$NIXOS_RELEASE.tar.gz" home-manager || \
die "Failed to add home-manager channel"
else
sudo nix-channel --add "https://github.com/nix-community/home-manager/archive/release-$NIXOS_RELEASE.tar.gz" home-manager || \
die "Failed to add home-manager channel"
fi
if ! command -v nix-channel >/dev/null 2>&1; then
nix-channel --update || die "Failed to update channels"
else
sudo nix-channel --update || die "Failed to update channels"
fi
if command -v nix-shell >/dev/null 2>&1; then
sudo nix-shell '<home-manager>' -A install || die "Failed to install home-manager (sudo)"
fi
nix-channel --add "https://github.com/nix-community/home-manager/archive/release-$NIXOS_RELEASE.tar.gz" home-manager || die "Failed to add home-manager channel"
nix-channel --update || die "Failed to update channels"
nix-shell '<home-manager>' -A install || die "Failed to install home-manager"
}