gmodena / nix-flatpak

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

installer: add fallback values to uninstall jq command to avoid bugs #39

Closed Tomaszal closed 8 months ago

Tomaszal commented 8 months ago

This is a follow up on https://github.com/gmodena/nix-flatpak/pull/24#issuecomment-1917639479. I looked into it and turns out I actually already implemented it correctly for overrides, using fallback values in jq (i.e. null // [] and null // {}), so that bug shouldn't occur there. But I think it's also worth implementing it that way for uninstalls, as it's a bit more resilient than comparing old state to an empty object. F.e. if the old state is not an empty object, but is missing the "packages" key for some reason, this would still work (as opposed to the current solution). It's not really necessary right now, but it might avoid bugs in the future.

gmodena commented 8 months ago

thanks for this f/up @Tomaszal !