gmodena / nix-flatpak

Install flatpaks declaratively
Apache License 2.0
276 stars 10 forks source link

How to pass arguments to app #70

Closed Axolord closed 2 weeks ago

Axolord commented 2 months ago

Hi, I found that electron based apps (and chromium derivatives itself) need to be run with extra arguments to start in a wayland session. So for ungoogled chromium I need to run flatpak run io.github.ungoogled_software.ungoogled_chromium --ozone-platform-hint=auto to have proper scaling and such.

Is there a way to add this argument declarative?

Thanks!

gmodena commented 2 months ago

Hi @Axolord . nix-flatpak does not provide a wrapper for flatpak run or any launcher scripts. You can customize application requirements with services.flatkpatk.overrides (it wraps flatpak override), but not parametrize run.

For you use case, did you consider aliasing ungoogled_chromium in your shell config? Or maybe having a script with the desired flatpak run command params.

Either way, you should be able to do it declaratively with Nix. The specific method is somewhat system-dependent; on NixOS, you could use shellAlias.

gmodena commented 2 weeks ago

Closing for now. Feel free to open a discussion thread might you want to follow up on this issue.