nixos/pcscd: expose package as option; pcsclite: enable structuredAttrs, separateDebugInfo, strictDeps (#525482)

This commit is contained in:
Sandro 2026-06-06 22:37:31 +00:00 committed by GitHub
commit 73809269bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 5 deletions

View file

@ -10,8 +10,6 @@ let
builtins.concatStringsSep "\n\n" config.services.pcscd.readerConfigs
);
package = if config.security.polkit.enable then pkgs.pcscliteWithPolkit else pkgs.pcsclite;
pluginEnv = pkgs.buildEnv {
name = "pcscd-plugins";
paths = map (p: "${p}/pcsc/drivers") config.services.pcscd.plugins;
@ -36,6 +34,11 @@ in
options.services.pcscd = {
enable = lib.mkEnableOption "PCSC-Lite daemon, to access smart cards using SCard API (PC/SC)";
package = (lib.mkPackageOption pkgs "pcsclite" { }) // {
default = if config.security.polkit.enable then pkgs.pcscliteWithPolkit else pkgs.pcsclite;
defaultText = lib.literalExpression "if config.security.polkit.enable then pkgs.pcscliteWithPolkit else pkgs.pcsclite";
};
plugins = lib.mkOption {
type = lib.types.listOf lib.types.package;
defaultText = lib.literalExpression "[ pkgs.ccid ]";
@ -101,8 +104,8 @@ in
config = lib.mkIf config.services.pcscd.enable {
environment.etc."reader.conf".source = cfgFile;
environment.systemPackages = [ package ];
systemd.packages = [ package ];
environment.systemPackages = [ cfg.package ];
systemd.packages = [ cfg.package ];
services.pcscd.plugins = [ pkgs.ccid ];
@ -133,7 +136,7 @@ in
# https://github.com/NixOS/nixpkgs/issues/121088
serviceConfig.ExecStart = [
""
"${lib.getExe package} -f -x -c ${cfgFile} ${lib.escapeShellArgs cfg.extraArgs}"
"${lib.getExe cfg.package} -f -x -c ${cfgFile} ${lib.escapeShellArgs cfg.extraArgs}"
];
};

View file

@ -88,6 +88,10 @@ stdenv.mkDerivation (finalAttrs: {
moveToOutput bin/pcsc-spy "$dev"
'';
__structuredAttrs = true;
separateDebugInfo = true;
strictDeps = true;
nativeBuildInputs = [
meson
ninja