Issues enabling Flathub in salt config

Hi all,

I am trying to write a salt config to install flatpak in a fedora template and add a remote to flathub.

Flatpak installs just fine however adding the flathub remote is proving troublesome.

Please note, when I set this up manually it works fine.

export https_proxy=http://127.0.0.1:8082/

flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo

The issue is that I cannot seem to set the https_proxy var in the salt config to be able to add the remote:

# this part works
flatpak_install: 
  pkg.installed:
    - pkgs:
      - flatpak

# this doesnt 
flatpak_add_flathub:
  cmd. run:
    - name: flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
    - env:
      - https_proxy: 127.0.0.1:8082
            
# I also tried something like this - didnt work 
flatpak_add_flathub:
  cmd. run:
    - name: export https_proxy: 127.0.0.1:8082 && flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo

Thanks.

Also, once the flathub remote has been added to a template I am able to search for flatpaks via command line. However I am unable to install flatpaks, I get a ‘error searching for remote’.

I have seen some posts recommending use of flatpaks in AppVM’s with the --user flag. However is there are way / what are best practices for using flatpaks in templates?