nix-flatpak icon indicating copy to clipboard operation
nix-flatpak copied to clipboard

bug(docs): declarative-flatpak is not generational

Open Malix-Labs opened this issue 4 months ago • 6 comments

Context

https://github.com/gmodena/nix-flatpak/blob/f3cf46a120cf17f0a2517667666db5adb8e60ae3/README.md?plain=1#L200-L201

Object

https://github.com/in-a-dil-emma/declarative-flatpak/issues/44#issuecomment-3165344083:~:text=declarative%2Dflatpak%20%22generational%22-,It%20doesn%27t.%20My%20module%20has%20never%20been%20generational.,-Also%20to%20me from @in-a-dil-emma:

My module (declarative-flatpak) has never been generational

Malix-Labs avatar Aug 07 '25 18:08 Malix-Labs

I already submitted a PR #169

in-a-dil-emma avatar Aug 07 '25 19:08 in-a-dil-emma

Hey - thanks for reaching out.

My mistake! I may have misunderstood some implementation details when I looked at that implementation a while ago. IIRC it cached packages between activation (which I have labelled as "generations"), while nix-flatpak did not - or so I thought. Happy to credit your project in whatever way characterizes it best @in-a-dil-emma .

FWIW: I wrote in the README that:

upon a system rebuild and rollbacks, changes in packages declaration will result in downloading applications anew.

But this is not the case anymore. Oof. This doc needs some work.

gmodena avatar Aug 07 '25 20:08 gmodena

But this is not the case anymore

Do you happen to have implemented caching in Nix store for them?

Malix-Labs avatar Aug 07 '25 23:08 Malix-Labs

But this is not the case anymore

Do you happen to have implemented caching in Nix store for them?

No, integration with Nix store is not planned (and would not be strictly required for caching).

Applications are not cached between activations/generations, but nix-flatpak's state management is a bit smarter nowadays than when that line was written. It will perform a lookup and diff revisions in old/new states before downloading applications (the very early versions would simply nuke all state and download anew. Not great).

gmodena avatar Aug 09 '25 07:08 gmodena

It will perform a lookup and diff revisions in old/new states before downloading applications

Ah yes, this would be nice to document

Malix-Labs avatar Aug 09 '25 12:08 Malix-Labs

@gmodena

My mistake! I may have misunderstood some implementation details when I looked at that implementation a while ago. IIRC it cached packages between activation (which I have labelled as "generations"), while nix-flatpak did not - or so I thought. Happy to credit your project in whatever way characterizes it best @in-a-dil-emma .

There used to be those pseudo-generations that were only there to prevent flatpak-ed applications from crashing, I considered adding rollbacks, but then I'd have to figure out how to link them to the nixos/hm generation the modern module just moves the current installation to $prefix/.module/trash/ and installs the new one from $prefix/.module/new

in-a-dil-emma avatar Aug 09 '25 18:08 in-a-dil-emma