Skip to content

Commit

Permalink
flatpak & snaps: Don't install in Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-revay committed Aug 14, 2024
1 parent d2b9a7e commit 8e83e97
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 41 deletions.
82 changes: 53 additions & 29 deletions CommonInitScripts/flatpaks_snaps_appimages_nix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,56 @@

. ../prelude.sh

# TODO add Nix package manager & nix packages

# TODO decide between flatpaks and snaps (or combine them)
# TODO VSC flatpak appears to be broken and lower quality than the snap
# TODO test the flatpaks

# TODO - is this needed?
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo

# TODO toread https://man7.org/linux/man-pages/man1/flatpak-install.1.html
readonly FLATPAK_PACKAGES=(
com.visualstudio.code
com.github.johnfactotum.Foliate
org.signal.Signal
com.sindresorhus.Caprine
com.spotify.Client
com.axosoft.GitKraken
)
time flatpak install --noninteractive --assumeyes flathub "${FLATPAK_PACKAGES[@]}"

# TODO verify Installing snaps from a list is not idempotent for some reason TODO try fixing
# TODO reloading bashrc might be needed (SNAP)
readonly SNAP_PACKAGES=(
core
snap-store
todoist
)
time sudo snap refresh
time print0 "${SNAP_PACKAGES[@]}" | xargs -0 -I % sudo snap install %
# TODO skip install if running inside a docker container and print warning
# TODO print the text in color and review the code for Docker skipping.
# TODO maybe the way of detecting docker is not great (try improving)
if [ -f /.dockerenv ]; then
echo "The initPC script is running inside a Docker container"
echo "Skipping installation of flatpaks/snaps/appimages/nix packages"
else
echo "The initPC script is not running inside Docker"
echo "Installing flatpaks/snaps/appimages/nix packages"

# TODO add Nix package manager & nix packages
# maybe Nix packages can be used in Docker? TODO

# TODO decide between flatpaks and snaps (or combine them)
# TODO VSC flatpak appears to be broken and lower quality than the snap
# TODO test the flatpaks

# TODO - is this needed?
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo

# TODO toread https://man7.org/linux/man-pages/man1/flatpak-install.1.html
readonly FLATPAK_PACKAGES=(
com.visualstudio.code
com.github.johnfactotum.Foliate
org.signal.Signal
com.sindresorhus.Caprine
com.spotify.Client
com.axosoft.GitKraken
)
time flatpak install --noninteractive --assumeyes flathub "${FLATPAK_PACKAGES[@]}"

# TODO verify Installing snaps from a list is not idempotent for some reason TODO try fixing
# TODO reloading bashrc might be needed (SNAP)
# list install is not idempotent for some reason - TODO fix
# TODO benchmark the performance of snap vs. cargo
# rust packages and maybe switch back to cargo
# but install specific versions so that the script
# will not break easily.
readonly SNAP_PACKAGES=(
core
snap-store
todoist

# TODO add the CLI packages to UbuntuCLI (but use different install method)
dust
procs
onefetch
)
time sudo snap refresh
time print0 "${SNAP_PACKAGES[@]}" | xargs -0 -I % sudo snap install %
time sudo snap install helix --classic

fi
13 changes: 1 addition & 12 deletions UbuntuCLI/ubuntu_specific_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,4 @@

. ../prelude.sh

# consider avoiding or ifdefing snaps as they cannot be used in containers

# list install is not idempotent for some reason - TODO fix
# SNAP_PACKAGES+=(dust procs onefetch) -
# TODO benchmark the performance of snap vs. cargo
# rust packages and maybe switch back to cargo
# but install specific versions so that the script
# will not break easily.
time sudo snap install dust
time sudo snap install procs
time sudo snap install onefetch
time sudo snap install helix --classic
# TODO - remove this file if it will not be used

0 comments on commit 8e83e97

Please sign in to comment.