Skip to content

add pico-openpgp and pico-fido2#7

Merged
jetcookies merged 1 commit intolibrekeys:mainfrom
samos667:gpg
Mar 3, 2026
Merged

add pico-openpgp and pico-fido2#7
jetcookies merged 1 commit intolibrekeys:mainfrom
samos667:gpg

Conversation

@samos667
Copy link
Copy Markdown
Collaborator

Following librekeys/pico-fido2#8

This basically rewrite the entire repo, the purpose is to reuse code for multiple firmware build, while keeping the core logic.
The build (should) work, (I stop it when the first 16 packages of each firmware 'flavor' are built).

I have not tested the workflow.

@samos667 samos667 mentioned this pull request Feb 27, 2026
1 task
@samos667 samos667 changed the title add pico-fido-openpgp and pico-fido-gpg(pico-fido2) add pico-openpgp and pico-fido-gpg(pico-fido2) Feb 27, 2026
@samos667 samos667 force-pushed the gpg branch 2 times, most recently from d4c47bb to cb553be Compare February 27, 2026 22:16
@jetcookies jetcookies self-requested a review February 28, 2026 06:50
Copy link
Copy Markdown
Member

@jetcookies jetcookies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent changes! I really appreciate you taking the time to review the existing code and reorganize it in a much more maintainable way.

As an initial contributor to this repository, I’d like to get your thoughts on a few "implicit conventions." These were mostly established during past discussions with other project members, and it is my oversight that they weren't reflected in the documentation sooner.

Package Naming

Currently, the packages in this repo use their upstream repository names as the package name. This helps users quickly identify which project is being packaged. I noticed you set the name for pico-fido2 to pico-fido-gpg. While this is a great name that accurately describes the specific implementation, I am slightly hesitant because users looking for the original project might not recognize it. I’d like to hear your thoughts on this.

Custom Build Support

I currently use a packaging format that is fully compatible with nixpkgs. This is to support users who prefer to compile their own firmware (e.g., to change vidpid or enable debug info) without the overhead of setting up a full development environment.

For example, users—including those not using flakes—can run a command like this:

nix-build -E 'with import <nixpkgs> {}; callPackage ./pkgs/pico-fido/default.nix { 
  picoBoard="waveshare_rp2350_one"; 
  vidpid="Yubikey5"; 
  extraCmakeFlags=[ "-DPICO_DEBUG_INFO_IN_RELEASE=ON" ];
}'

Since your changes introduce a pico-lib, could you set a default import path for it within the base packages (like pico-fido)? This would ensure that users preferring the traditional workflow can still use it easily.

CI/CD & Versioning

The automatic logic introduced in the new CI workflow is a fantastic idea. However, since the librekeys repositories are transitioning to "hard forks," we haven't yet finalized how to handle version naming for these upstream-related changes. You are more than welcome to join our discussion on Matrix regarding this.

Future Roadmap & Considerations

I am planning a few upcoming changes that might be affected by this refactor:

  • Auto-update support: I plan to add an automatic update workflow (likely using nix-update or nvfetcher) to regularly update hashes and reduce maintenance burden. You can find examples in the picoforge repo. I'll need to test later if these scripts can still locate the required fields after your structural changes.
  • Cross-compilation (crossSystem): I’m working on shifting the build process to use crossSystem. This helps Nix automatically handle cmakeFlags like -DCMAKE_AR instead of us patching them manually, which caused issues in the past.
  • ESP32 Support: We are planning to build for the ESP32 platform, so the packaging functions may need further modifications for cross-platform compatibility.

Please note that these points are not mandatory requirements. Not meeting them will not block the merging process. The final decision on merging depends on the collective opinion of the team, and I am currently discussing this with other members.

Additionally, I'd be happy to grant you write permissions to the repository. This will allow you to create branches and push changes directly to the repo.

Thank you again for your valuable contribution! We appreciate your patience while the community makes its final decision.

@jetcookies
Copy link
Copy Markdown
Member

jetcookies commented Feb 28, 2026

Please wait for librekeys/pico-keys-sdk#3 to complete and update your package.

@samos667
Copy link
Copy Markdown
Collaborator Author

Custom Build Support

You're right, the only viable path to handle this is by not using flake

Package Naming

It was just a kick up the backside regarding this stupid naming scheme (Soon it will be 'pico-fido3' for 'pico-fido-gpg-hsm'...).
But I totally understand that users have their habits. To be honest, I don't care that much. I turn to you (and the other maintainers) for this kind of decision.

@samos667 samos667 force-pushed the gpg branch 2 times, most recently from 97d1bd9 to b43d343 Compare February 28, 2026 07:32
Comment thread pkgs/pico-fido/default.nix Outdated
Comment thread pkgs/pico-openpgp/default.nix Outdated
Comment thread .github/workflows/pico-firmwares.yml Outdated
Comment thread pkgs/pico-fido/default.nix Outdated
Comment thread pkgs/pico-fido-gpg/default.nix Outdated
Comment thread pkgs/pico-openpgp/default.nix Outdated
Comment thread pkgs/pico-fido-gpg/default.nix Outdated
Comment thread pkgs/pico-fido-gpg/default.nix Outdated
Comment thread lib/default.nix Outdated
Comment thread .github/workflows/pico-firmwares.yml Outdated
Comment thread .github/workflows/pico-firmwares.yml Outdated
@samos667 samos667 marked this pull request as draft March 1, 2026 04:47
@lockedmutex
Copy link
Copy Markdown
Member

@jetcookies does it means, the firmware releases will not have pico-fido, pico-fido2, pico-hsm and pico-openpgp firmwares too? or there will be different releases for each firmware.

If later is the case, then it would be better to put links in readme to point to latest releases of each firmware. And put some more info about this repo in readme, so users do not open invalid issues.

@jetcookies
Copy link
Copy Markdown
Member

@jetcookies does it means, the firmware releases will not have pico-fido, pico-fido2, pico-hsm and pico-openpgp firmwares too? or there will be different releases for each firmware.

If later is the case, then it would be better to put links in readme to point to latest releases of each firmware. And put some more info about this repo in readme, so users do not open invalid issues.

Based on the CI files, pico-fido, pico-fido2, and pico-openpgp will be released under tags starting with their respective names. These releases are independent of each other, each tracking its intended stable version.

Adding guidance on where to download the firmware is indeed necessary, but alternative approaches exist. For instance, configuring picoforge to automatically download the required firmware. Or simply splitting this repository and building each firmware in its own dedicated repository.

I have no personal preference on this matter; it depends on which implementation other members favor.

@samos667 samos667 changed the title add pico-openpgp and pico-fido-gpg(pico-fido2) add pico-openpgp and pico-fido2 Mar 1, 2026
@lockedmutex
Copy link
Copy Markdown
Member

@jetcookies

Or I was thinking, to split firmware builds into the firmware repos itself. pico-fido will releases the firmware builds for pico-fido, pico-fido2 will release firmware builds for pico-fido2. etc... and pico-fido-firmwares just stores all the nix code( or code for any other build system as proposed by @gxcreator ) that will be used by workflows in each repo to build the firmware.
This might be better.
So we do not pollute each repo with workflow related code, issues and prs.
All firmware build code, issues, and prs solely lie in the pico-fido-firmwares repo.

However I doubt how well it would scale in future. Either way, let the people here decide how it should be done and will proceed with that.

@Lab-8916100448256
Copy link
Copy Markdown
Member

Please wait for librekeys/pico-keys-sdk#3 to complete and update your package.

That PR has been merged. You can use the tag v8.5.1-librekeys to get the corresponding commit

@samos667 samos667 force-pushed the gpg branch 2 times, most recently from 0f895be to 61a6830 Compare March 3, 2026 16:00
@jetcookies
Copy link
Copy Markdown
Member

jetcookies commented Mar 3, 2026

Please also update .github/workflows/check-flake-packages.yml#L27 to include pico-openpgp and pico-fido2:

nix build --no-link --print-build-logs .#pico-fido .#pico-fido2 .#pico-openpgp

This way we can still automatically check whether the compilation passes (for the automatic update script).

@samos667 samos667 force-pushed the gpg branch 2 times, most recently from e27a7f0 to d6efee3 Compare March 3, 2026 16:08
Comment thread pkgs/pico-fido/default.nix Outdated
Comment thread .github/workflows/check-flake-packages.yml Outdated
Comment thread lib/default.nix Outdated
@samos667 samos667 force-pushed the gpg branch 2 times, most recently from 61a6f73 to f358eb0 Compare March 3, 2026 17:31
@samos667 samos667 marked this pull request as ready for review March 3, 2026 19:54
@samos667 samos667 requested a review from jetcookies March 3, 2026 19:56
Copy link
Copy Markdown
Member

@jetcookies jetcookies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Could you also update .github/workflows/update-flake-packages.yml#L38 by adding the remaining *-firmwares there to prevent the update script from failing?

@samos667 samos667 force-pushed the gpg branch 2 times, most recently from 174a793 to dced7ed Compare March 3, 2026 20:16
@jetcookies jetcookies merged commit 0e7e1b6 into librekeys:main Mar 3, 2026
1 check passed
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.

5 participants