summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--trivionomicon/modules/athena-bccr/hm.nix11
-rw-r--r--trivionomicon/modules/athena-bccr/options.nix48
-rw-r--r--trivionomicon/modules/athena-bccr/sys.nix14
-rw-r--r--trivionomicon/pkgs/athena-bccr/default.nix12
-rw-r--r--trivionomicon/pkgs/athena-bccr/firmador.nix2
5 files changed, 43 insertions, 44 deletions
diff --git a/trivionomicon/modules/athena-bccr/hm.nix b/trivionomicon/modules/athena-bccr/hm.nix
index df41f12..683cb4d 100644
--- a/trivionomicon/modules/athena-bccr/hm.nix
+++ b/trivionomicon/modules/athena-bccr/hm.nix
@@ -5,12 +5,11 @@
doctrine,
...
}: let
- athena =
- (pkgs.${doctrine.prefix}.athena-bccr.override {
- inherit (cfg) mirror;
- }).${
- cfg.release
- };
+ releases = pkgs.${doctrine.prefix}.athena-bccr.override {
+ inherit (cfg) mirror vendor;
+ };
+
+ athena = releases.${cfg.release};
in {
home.packages = [
athena.firmador
diff --git a/trivionomicon/modules/athena-bccr/options.nix b/trivionomicon/modules/athena-bccr/options.nix
index 7b6cf93..dc4c986 100644
--- a/trivionomicon/modules/athena-bccr/options.nix
+++ b/trivionomicon/modules/athena-bccr/options.nix
@@ -1,42 +1,40 @@
{lib, ...}:
-with lib.types; {
+with lib.types; let
+ mirror = lib.mkOption {
+ type = nullOr str;
+ default = null;
+ description = "release zip mirror base URL, if null then the release zip must be manually added to the Nix store";
+ };
+
+ release = lib.mkOption {
+ type = str;
+ default = "latest";
+ description = "pinned athena-bccr release tag";
+ };
+
+ vendor = lib.mkOption {
+ type = enum ["athena" "idopte"];
+ default = "idopte";
+ description = "driver dvendor";
+ };
+in {
hm = {
+ inherit mirror release vendor;
+
gaudiHash = lib.mkOption {
type = nullOr str;
default = null;
description = "hash of the Gaudi client";
};
-
- mirror = lib.mkOption {
- type = nullOr str;
- default = null;
- description = "release zip mirror base URL, if null then the release zip must be manually added to the Nix store";
- };
-
- release = lib.mkOption {
- type = str;
- default = "latest";
- description = "pinned athena-bccr release tag";
- };
};
sys = {
+ inherit mirror release vendor;
+
group = lib.mkOption {
type = str;
default = "users";
description = "user group with full access to the smartcard reader";
};
-
- mirror = lib.mkOption {
- type = nullOr str;
- default = null;
- description = "release zip mirror base URL, if null then the release zip must be manually added to the Nix store";
- };
-
- release = lib.mkOption {
- type = str;
- default = "latest";
- description = "pinned athena-bccr release tag";
- };
};
}
diff --git a/trivionomicon/modules/athena-bccr/sys.nix b/trivionomicon/modules/athena-bccr/sys.nix
index bd7d758..0b4658c 100644
--- a/trivionomicon/modules/athena-bccr/sys.nix
+++ b/trivionomicon/modules/athena-bccr/sys.nix
@@ -6,17 +6,15 @@
doctrine,
...
}: let
- athena =
- (pkgs.${doctrine.prefix}.athena-bccr.override {
- inherit (cfg) mirror;
- }).${
- cfg.release
- };
-
- inherit (athena) vendor;
+ releases = pkgs.${doctrine.prefix}.athena-bccr.override {
+ inherit (cfg) mirror vendor;
+ };
+ athena = releases.${cfg.release};
driver = athena.card-driver.lib;
scmiddleware = "${driver}/lib/SCMiddleware";
+
+ inherit (cfg) vendor;
in {
environment = {
etc =
diff --git a/trivionomicon/pkgs/athena-bccr/default.nix b/trivionomicon/pkgs/athena-bccr/default.nix
index 038220b..c17911e 100644
--- a/trivionomicon/pkgs/athena-bccr/default.nix
+++ b/trivionomicon/pkgs/athena-bccr/default.nix
@@ -2,10 +2,14 @@
callPackage,
lib,
mirror ? null,
+ vendor ? "idopte",
}: let
- latest = "deb64-rev26.2";
+ releases = lib.mapAttrs resolveRelease (import ./releases.nix).${vendor};
- releases = lib.mapAttrs (name: release: release // {name = name;}) (import ./releases.nix);
+ resolveRelease = name: release:
+ if builtins.isString release
+ then releases.${release}
+ else release // {name = name;};
overrideUnwrapped = default: new: let
args = default // new;
@@ -19,7 +23,7 @@
pkgsForRelease = release: let
inherit (unwrapped) card-driver bccr-cacerts;
- unwrapped = overrideUnwrapped {inherit mirror release;} {};
+ unwrapped = overrideUnwrapped {inherit mirror release vendor;} {};
pkcs11-module = "${card-driver.lib}/${card-driver.pkcs11-path}";
in {
inherit card-driver bccr-cacerts pkcs11-module;
@@ -29,4 +33,4 @@
firmador = callPackage ./firmador.nix {inherit pkcs11-module;};
};
in
- lib.mapAttrs (_: pkgsForRelease) (releases // {latest = releases.${latest};})
+ lib.mapAttrs (_: pkgsForRelease) releases
diff --git a/trivionomicon/pkgs/athena-bccr/firmador.nix b/trivionomicon/pkgs/athena-bccr/firmador.nix
index e8e0a2d..feec48e 100644
--- a/trivionomicon/pkgs/athena-bccr/firmador.nix
+++ b/trivionomicon/pkgs/athena-bccr/firmador.nix
@@ -27,7 +27,7 @@ in
./0001-Remove-CheckUpdatePlugin-from-default-list.patch
];
- mvnHash = "sha256-iqooTe8xTrkG0JxJXlAMHExt6D8n+msB/VrCNrSJ10c=";
+ mvnHash = "sha256-QDjhwrKZK/cEQxRYUM+z1zMCNrTHyxRqAhUfNtubhhI=";
nativeBuildInputs = [
makeWrapper