-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to specify a location to a flatpak ref for a application? #78
Comments
Hey @SpiderUnderUrBed , I'm working on adding the capability to install from local flatpaks (as a way to improve testing). I need to look into supporting generic URI, but that sounds like a nice feature to have. |
Supporting installation from a flatpakref URL is pretty straightforward. What complicates things slightly is this behavior: flatpak fails to
The second command should throw an error. This would be nix-flatpak install/update lifecycle. The only workaround I can think of is downloading the |
What does this look like in nix? Like you specify: Also does this mean generic URI's cant be supported? A way of implementation would require a potentially different install/update lifecycle for file paths. Or URLS to flatpakrefs. |
This is my current workaround for this issue. I noticed that Seems to work flawlessly so far. |
I did some further testing. This might require some adjustments to the state management logic to avoid breaking configurations that declare When you run For example, when I install with
Even If I select
Unless the repository is explicitly declared in @Bear-03 gave a neat example of how to automate remote declaration configs. A
With this, you can declare a remote and package as:
Where You could follow the example @Bear-03 provided and automate parsing of the flapakref. All in all, I think this approach is less error prone than trying to manage remote /application state implicitly. Would it be useful if |
I did try this before and unfortunately, in my case it causes the following error:
As I understand it, it's missing the GPG key tht is included in the I don't know how nix-flatpak works internally, but wouldn't it be possible to know that a certain repo does not have to be uninstalled because it is (implicitly) needed for a flatpakref package? If the package list is traversed and some packages are flatpakrefs, the names of their repos should be extracted from the files and even if |
Also to answer your proposal, nix-flatpak should definitely add helper functions, I tried Bear-03's configuration and it yielded no errors, so I assume its done its job (I didn't re-install sober but I will try later). However, the current method is quite unintuitive and probably with caveats. |
Hey @Bear-03
Good call. I think the pub key got cached in my experiments. I tried on a freshly built vm, and can repro that error.
Yep, it can be done pretty much the way you describe it. I have a PoC that needs a little flashing out (mostly internal APIs) and some more testing. I do like your approach though, because it makes remote declaration explicit. I was about to suggest you could pass the GPG key by injecting custom |
Even then, in the long run I think it would be much cleaner to allow passing |
Also the ability to specify .flatpakrepo's could come in handy (in the case of local flatpak development or there might be a case where you don't have a repo at all). Specifying a .flatpakrepo should also be a feature at some point. |
Isn't that already possible though? you can provide a local path with |
Specifying a protocol is, in my opinion, good practice, but in case of |
@Bear-03 @SpiderUnderUrBed I still need to add some unit tests before resolving, but if you want to give it a go #80 should be in a decent enough shape. You can test the feature by tracking the
|
I am getting an issue with the whole install/reinstall cycle as you said:
Here is my nixos config files (under flatpak.nix, also forgive me if it looks a little weird, I haven't cleaned up the comments and had a rebase mishap): |
@SpiderUnderUrBed thanks for giving it a go! Could you paste me the content of |
I load nix-flatpak as a nixos module: |
@SpiderUnderUrBed thanks for sharing.
the remote should have been removed only after the package was uninstall. Could you look in your system logs for failures wrt uninstalling Could you try to uninstall the package and remote manually with:
|
This error should be replicated if you install a remote, like "sober" which is a remote automatically made when you install from a flatpak ref. Then you install something from that remote, which is sober itself (from the flatpakref). I am confident this happens because uninstallUnmanaged is true, I don't know if you want this behavior to exist though, should it just skip uninstalling remotes with an existing ref (flatpakref installed from it)? or should it try to uninstall the ref first then the remote? |
I did try to repro with First activation looks like this:
Remote and application have been installed. Second activation:
Remote and application are not installed in this generation (they have both been uninstalled on activation).
The expected behavior is that the I don't know why your system ended up in a state where the remote is uninstallable because of a dangling ref. Could it be that at some point you installed the remote/app both declaratively and manually with Maybe a failsafe is needed for this scenario:
Defaulting to |
https://pastebin.com/HBDFHbYv
and I already sent a link to my repo, I think I found the source of the issue, its like you said, multiple remotes. I don't know if you tested dangling refs/my issue but I think you should be able to get the same error if you reproduce it that way. Then you can address this bug with your suggested failsafe. |
Thanks for confirming.
I'll open a dedicate PR for this. |
Hey @gmodena, I recently migrated to the new way of specifying
The issue is fixed if i run |
Okay perfect, I'll keep an eye on #90 then in case any help is needed. |
hey @Bear-03 , if you have some time to spare, I could use help with testing #93. Would you mind tying an activation tracking the |
Hey @gmodena! I just tested it and it still fails.
|
@Bear-03 many thanks for testing. I'm a bit at a loss on this one. I've been daily driving that branch for a few days now (with Sober), and did not stumble upon the Did you try manually uninstalling sober before the activation? Could you maybe check in This comments documents how I'm testing that branch in a VM: Could you maybe help me pin-point what I might be doing different than you, either in terms of config or activation steps? |
Hello, I want to install sober declaratively using nix flatpak, however sober is not published on flathub or any repo, so I was wondering how i could specify the link to the ref file and have it automatically install? is this possible currently? if not then can it be worked on?
Here is the how they ship their flatpak ref:
https://sober.vinegarhq.org/sober.flatpakref
The text was updated successfully, but these errors were encountered: