summaryrefslogtreecommitdiff
path: root/modules/athena-bccr/sys.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/athena-bccr/sys.nix')
-rw-r--r--modules/athena-bccr/sys.nix35
1 files changed, 35 insertions, 0 deletions
diff --git a/modules/athena-bccr/sys.nix b/modules/athena-bccr/sys.nix
new file mode 100644
index 0000000..631185d
--- /dev/null
+++ b/modules/athena-bccr/sys.nix
@@ -0,0 +1,35 @@
+{
+ pkgs,
+ lib,
+ cfg,
+ doctrine,
+ ...
+}: let
+ athena = pkgs.${doctrine.prefix}.athena-bccr.${cfg.release};
+in {
+ environment = {
+ etc = {
+ "Athena".source = "${athena.ase-pkcs11}/etc/Athena";
+
+ "pkcs11/modules/asep11".text = ''
+ module: ${athena.libasep11}
+ '';
+ };
+
+ systemPackages = [athena.ase-pkcs11];
+ };
+
+ #FIXME: Extremadamente peligroso si BCCR o MICITT caen, investigar polĂ­tica nacional de root CA
+ security.pki.certificateFiles = ["${athena.bccr-cacerts}/root-ca.pem"];
+
+ services = {
+ pcscd.enable = true;
+
+ udev.extraRules = ''
+ # Athena Smartcard Solutions, Inc. ASEDrive V3CR
+ ATTRS{idVendor}=="0dc3", ATTRS{idProduct}=="1004", MODE="660", GROUP="${cfg.group}", TAG+="uaccess"
+ '';
+ };
+
+ users.groups.${cfg.group} = {};
+}