yawnt / declarative-nix-flatpak

flatpak-install, but declarative
MIT License
48 stars 0 forks source link

Can you help me use this with Steam? #1

Open spikespaz opened 2 years ago

spikespaz commented 2 years ago

When running flatpak install com.valvesoftware.Steam:

Looking for matches…

com.valvesoftware.Steam permissions:
    ipc                    network                pulseaudio             wayland                       x11            devices       bluetooth       devel       multiarch
    per-app-dev-shm        file access [1]        dbus access [2]        system dbus access [3]        tags [4]

    [1] xdg-music:ro, xdg-pictures:ro, xdg-run/app/com.discordapp.Discord:create
    [2] org.freedesktop.Notifications, org.freedesktop.PowerManagement, org.freedesktop.ScreenSaver, org.gnome.SettingsDaemon.MediaKeys, org.kde.StatusNotifierWatcher
    [3] org.freedesktop.NetworkManager, org.freedesktop.UDisks2, org.freedesktop.UPower
    [4] proprietary

        ID                               Branch          Op          Remote           Download
 1.     com.valvesoftware.Steam          stable          i           flathub          < 14.2 MB

Proceed with these changes to the system installation? [Y/n]: 

I don't know that much about Flatpak internals and would like assistance satisfying all of the runtime dependencies shown above. I see that there is one argument: --ro-bind ${runtime} $FLATPAK_DIR/runtime in the shell code generated from wrapFlatpakLauncher. What directories need to be bound for example, org.freedesktop.NetworkManager?

How can I see more details about what flatpak install does under the hood? Do all of the arguments here: https://github.com/flathub/com.valvesoftware.Steam/blob/beta/com.valvesoftware.Steam.yml#L18 need to be passed to flatpak run as well?

spikespaz commented 2 years ago

https://sr.ht/~fgaz/nix-bubblewrap/

yawnt commented 2 years ago

Hi!

I'm not an expert but this is what I figured out. flatpak install basically does two things: it installs a runtime and an application.

Everything that is needed to run the application is bundled inside app and runtime, so you just need to do flatpak run and it should apply all the arguments that you see in the .yml file.

That means that you shouldn't have to bind anything yourself as flatpak will take care of NetworkManager etc... Note that those are permissions, not dependencies that need to be downloaded.

Now I took a look at the .yml and it looks like Steam requires some extensions. I haven't implemented support for that, so it's possible that we need to change the code such that you can specify extensions = [ .. ] on top of runtime = [..], when installing an app.

yawnt commented 2 years ago

Sorry, my bad. That's for the SDK, not the runtime.

The runtime is

runtime: org.freedesktop.Platform
runtime-version: &runtime-version '22.08'

That also requires extensions, so my reasoning above still stands regarding adding support for that.