trivionomicon: athena-bccr: add support for mirrors

This commit is contained in:
Alejandro Soto 2026-03-09 15:25:05 -06:00
parent 789b1780cb
commit 286c49e369
5 changed files with 41 additions and 5 deletions

View file

@ -5,7 +5,12 @@
doctrine, doctrine,
... ...
}: let }: let
athena = pkgs.${doctrine.prefix}.athena-bccr.${cfg.release}; athena =
(pkgs.${doctrine.prefix}.athena-bccr.override {
inherit (cfg) mirror;
}).${
cfg.release
};
in { in {
home.packages = [ home.packages = [
athena.firmador athena.firmador

View file

@ -7,6 +7,12 @@ with lib.types; {
description = "hash of the Gaudi client"; 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 { release = lib.mkOption {
type = str; type = str;
default = "latest"; default = "latest";
@ -21,6 +27,12 @@ with lib.types; {
description = "user group with full access to the smartcard reader"; 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 { release = lib.mkOption {
type = str; type = str;
default = "latest"; default = "latest";

View file

@ -6,7 +6,13 @@
doctrine, doctrine,
... ...
}: let }: let
athena = pkgs.${doctrine.prefix}.athena-bccr.${cfg.release}; athena =
(pkgs.${doctrine.prefix}.athena-bccr.override {
inherit (cfg) mirror;
}).${
cfg.release
};
inherit (athena) vendor; inherit (athena) vendor;
driver = athena.card-driver.lib; driver = athena.card-driver.lib;

View file

@ -1,6 +1,7 @@
{ {
callPackage, callPackage,
lib, lib,
mirror ? null,
}: let }: let
latest = "deb64-rev26.2"; latest = "deb64-rev26.2";
@ -18,7 +19,7 @@
pkgsForRelease = release: let pkgsForRelease = release: let
inherit (unwrapped) card-driver bccr-cacerts; inherit (unwrapped) card-driver bccr-cacerts;
unwrapped = overrideUnwrapped {inherit release;} {}; unwrapped = overrideUnwrapped {inherit mirror release;} {};
pkcs11-module = "${card-driver.lib}/${card-driver.pkcs11-path}"; pkcs11-module = "${card-driver.lib}/${card-driver.pkcs11-path}";
in { in {
inherit card-driver bccr-cacerts pkcs11-module; inherit card-driver bccr-cacerts pkcs11-module;

View file

@ -1,5 +1,7 @@
{ {
fetchurl,
lib, lib,
mirror ? null,
requireFile, requireFile,
release, release,
gaudiHash ? null, gaudiHash ? null,
@ -7,10 +9,20 @@
}: let }: let
inherit (release) srcPaths vendor; inherit (release) srcPaths vendor;
src = requireFile { url =
url = "https://soportefirmadigital.com"; if mirror != null
then "${mirror}/${release.filename}"
else "https://soportefirmadigital.com";
fetchSrc =
if mirror != null
then fetchurl
else requireFile;
src = fetchSrc {
name = release.filename; name = release.filename;
inherit url;
inherit (release) hash; inherit (release) hash;
}; };