How to declaratively list the flatpak applications to install?

In BlendOS, how can we declaratively list the flatpak applications to install?
Solution:
to do it declaratively, though, you could add stuff in commands to run flatpak install $THING as your user
Jump to solution
11 Replies
Asterisk
Asterisk2mo ago
open the software store you install flatpaks normally you never install flatpaks as root
Solution
hanna (password generator)
to do it declaratively, though, you could add stuff in commands to run flatpak install $THING as your user
hanna (password generator)
like this:
su -c 'flatpak install md.obsidian.Obsidian` $USER
su -c 'flatpak install md.obsidian.Obsidian` $USER
as for myself, i'll probably just have setup scripts that i run once instead - i've already got that for arch anyways, i'm just porting it over for the few things that are different in blendos
krishnakumar
krishnakumar2mo ago
Thanks
VisioAer
VisioAer2mo ago
Tried this in /system.yaml:
commands:
- 'locale-gen'
- 'su -c `flatpak install flathub com.brave.Browse` $USER'
commands:
- 'locale-gen'
- 'su -c `flatpak install flathub com.brave.Browse` $USER'
But that didn't work. For now using flatpak list --columns=application --app > flatpaks.txt for creating a list of installed flatpaks and xargs flatpak install -y < flatpaks.txt and keeping a backup of my flatpaks.txt so I can reinstall them on a different system easily.
hanna (password generator)
not literally $USER, replace it with your username $USER is whatever user it's running as, but since that runs as root, that would run it as root also, you're using grave accent for encompassing the command, but that would run it with command substitution it should be a string instead like this:
commands:
- 'locale-gen'
- 'su -c "flatpak install flathub com.brave.Browse" your_username_here'
commands:
- 'locale-gen'
- 'su -c "flatpak install flathub com.brave.Browse" your_username_here'
VisioAer
VisioAer2mo ago
Ah thanks, gonna try that right away 🙂 Unfortunately, that didn't work, also not with th -y install option: like this:
commands:
- 'locale-gen'
- 'su -c "flatpak install -y flathub com.brave.Browse" your_username_here'
commands:
- 'locale-gen'
- 'su -c "flatpak install -y flathub com.brave.Browse" your_username_here'
and yeah, replaced your_username_here with my username 🙂
limby-giga-Shakman🇪🇬
without su -c
Asterisk
Asterisk2mo ago
why do you need to do this again your user folder is preserved on rebuilds
hanna (password generator)
my guess is they just want to be able to rebuild it all from one file, rather than having it split across akshara and whatever scripts or nix or whatever for the user i was actually thinking of making an akshara-like thing (maybe fork it?) for normal stuff, since i'd like the ability to rebuild it all from one file as well well, two i suppose, the system file and the user file i've tried nix but it's definitely not what i'm looking for, i just want something like akshara to manage my dotfiles and setup scripts with the dotfiles just being their own files, not in nix files or anything like that, and i've gotten 80% of the way there with my own setup scripts i already have but that's rather off-topic, sorry for the rant
VisioAer
VisioAer2mo ago
Just want to be able to rebuild it all from one file, rather than having it split across akshara and whatever scripts or nix or whatever for the user
Yeah, exactly that, want to have the same stuff installed across different PC’s. Next step would also be adding containers and apps/packages in those containers automatically, but that should be a run once thing, maybe flatpak installs should be too, but as flatpak just does nothing when something is already installed, I guess it would be fine to have it in the system.yaml or a track. //offtopic but it isn’t really clear to me how tracks work, have read and reread the docs, I got questions like as simple as: (but will search discord first before asking). “where do I put these track files? " "Can I use multiple tracks? Because I want to split things up because one system has an Intel GPU, the other one AMD and the other one NVIDIA or for the user or team that is going to use the system and they don't need all the stuff and it saves me from editing the system.yaml every time” Additionally, for disaster recovery on different hardware, it would be nice to just get your system.yaml + tracks and reinstall the thing and after that, only restore (certain) configs and user data and get going again.
Want results from more Discord servers?
Add your server