Skip to content
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

installer: add support for flatpakref. #80

Merged
merged 9 commits into from
Oct 15, 2024
Merged

installer: add support for flatpakref. #80

merged 9 commits into from
Oct 15, 2024

Conversation

gmodena
Copy link
Owner

@gmodena gmodena commented Oct 8, 2024

This is a WIP.

Issue #78

Adds support for installing application from a flatpakref uri.

Changes

When installing from a flatpakref, and packages will tracked in the gcroot state files:

  1. a package will be stored, with appId and origin set to the flatpakref's Name and SuggestRemoteName respectively.
  2. a remote with be stored labelled with SuggestRemoteName.

This should enable compatibility with state management APIs.

Testing

Workflow:

  1. declare a flatpakref package.
  2. on activation, the package and its remote are installed.
  3. remove the flatpakref declaration.
  4. on activation, the package and it's remote are removed.
  • Tested on a testing-base nixos VM , with nix-flatpak loaded as a home-manager module.
  • Tested on a testing-base nixos VM , with nix-flatpak loaded as a nixos module.
services.flatpak.remotes = lib.mkOptionDefault [{
   name = "flathub-beta";
   location = "https://flathub.org/beta-repo/flathub-beta.flatpakrepo";
};

services.flatpak.packages = [
    { 
      flatpakref="https://sober.vinegarhq.org/sober.flatpakref";
      sha256="1pj8y1xhiwgbnhrr3yr3ybpfis9slrl73i0b1lc9q89vhip6ym2l";
    }
  ];

Example state config.

cat /nix/var/nix/gcroots/flatpak-state.json:

{
    "overrides": {},
    "packages": [
       "org.vinegarhq.Sober"
    ],
    "remotes": [
        "flathub",
        "flathub-beta",
        "sober"
    ]
}

Adds support for installing application from a
flatpakref uri.
@gmodena gmodena self-assigned this Oct 8, 2024
@gmodena gmodena marked this pull request as draft October 8, 2024 18:57
@gmodena gmodena linked an issue Oct 8, 2024 that may be closed by this pull request
README.md Outdated Show resolved Hide resolved
@gmodena gmodena changed the title wip: installer: add support for flatpakref. installer: add support for flatpakref. Oct 9, 2024
@gmodena gmodena marked this pull request as ready for review October 9, 2024 21:26
@gmodena gmodena added this to the 0.5.0 milestone Oct 15, 2024
@gmodena gmodena merged commit 8d1193a into main Oct 15, 2024
1 check passed
@gmodena gmodena deleted the install-flatpakref branch October 20, 2024 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to specify a location to a flatpak ref for a application?
1 participant