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

vsmartcard-vpcd, vsmartcard-pcsc-relay: init at 0.9-unstable-2024-05-14, nixos/vsmartcard-vpcd: init #194957

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

StarGate01
Copy link
Member

@StarGate01 StarGate01 commented Oct 7, 2022

Description of changes

This PR adds the virtual smart card reader and relay: https://frankmorgner.github.io/vsmartcard/ . It can be used to e.g. emulate a smartcard when combined with e.g. https://jcardsim.org/ , or to debug smartcard communications via an Android phone bridge.

The service module service.services.vsmartcard-vpcd is used to enable and configure the virtual smart card driver. It appends a configuration to the pcscd readers.conf. To facilitate this, the readerConfig option of services.pcscd was upgraded to a list readerConfigs, which is internally joined into the single config file. The old readerConfig option has been marked as deprecated, but continues to work.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.11 Release Notes (or backporting 22.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@StarGate01
Copy link
Member Author

as for the configuration of pcscd, would it be preferable to provide configuration options instead of the readerConfig fragment? E.g.: (see also https://frankmorgner.github.io/vsmartcard/virtualsmartcard/README.html#configuring-vpcd-on-unix)

services.pcscd = {
  enable = true;
  vpcd = {
    enable = true;
    port = 35963;
    hostname = "/dev/null";
  };
  ...
};

The service definition would then generate and append the configuration to readerConfig, and ensure the vcpd package is loaded.

pkgs/top-level/all-packages.nix Outdated Show resolved Hide resolved
pkgs/by-name/vs/vsmartcard-vpcd/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/vs/vsmartcard-vpcd/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/vs/vsmartcard-vpcd/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/vs/vsmartcard-vpcd/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/vs/vsmartcard-pcsc-relay/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/vs/vsmartcard-pcsc-relay/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/vs/vsmartcard-pcsc-relay/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/vs/vsmartcard-pcsc-relay/package.nix Outdated Show resolved Hide resolved
@StarGate01 StarGate01 force-pushed the vsmartcard branch 2 times, most recently from a9b6474 to c0c180f Compare July 9, 2024 08:11
@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Jul 9, 2024
@StarGate01 StarGate01 marked this pull request as draft July 9, 2024 08:11
@StarGate01 StarGate01 force-pushed the vsmartcard branch 6 times, most recently from 28cac7e to 046f302 Compare July 9, 2024 09:17
@StarGate01 StarGate01 changed the title vsmartcard-vpcd, vsmartcard-pcsc-relay: init at 20220814 vsmartcard-vpcd, vsmartcard-pcsc-relay: init at 0.9-unstable-2024-05-14, nixos/vsmartcard-vpcd: init Jul 9, 2024
@StarGate01 StarGate01 marked this pull request as ready for review July 9, 2024 09:38
@StarGate01
Copy link
Member Author

StarGate01 commented Jul 9, 2024

@SuperSandro2000 I have implemented all of your suggestions, thank you!

I have also added a service module definition to make configuring the PCSC driver (with the default options) just a simple matter of

services.vsmartcard-vpcd = {
  enable = true;
};

The options port and hostname are exposed as well.

The services.pcscd option readerConfig was upgraded to a list readerConfigs, to allow collection of config fragments from multiple sources. The old option was marked as deprecated but continues to work.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/4220

@h7x4 h7x4 added the 8.has: module (new) This PR adds a module in `nixos/` label Jul 16, 2024
@StarGate01 StarGate01 force-pushed the vsmartcard branch 2 times, most recently from 50cb362 to f5dd523 Compare July 18, 2024 08:32
@StarGate01
Copy link
Member Author

Thank you @SuperSandro2000 for you suggestions, I have implemented them.

@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Sep 10, 2024
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (new) This PR adds a module in `nixos/` 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants