#!/bin/bash set -e enable_service() { systemctl daemon-reload ||: systemctl enable nvidia-desktop-default-snaps.service ||: echo "NVIDIA Desktop Default Snaps service enabled. Snaps will be seeded on next boot." } case "$1" in configure) # Check if we're in a chroot if ischroot; then # In chroot, schedule the service to run on first boot enable_service else # Not in chroot, try to run the snap seeding script directly if /usr/share/nvidia/nvidia-desktop-default-snaps/seed-default-snaps.sh; then echo "Default snaps seeded successfully." else # If it fails, enable the systemd service to run on next boot enable_service fi fi ;; esac exit 0