summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2026-03-09 15:25:05 -0600
committerAlejandro Soto <alejandro@34project.org>2026-03-09 15:25:31 -0600
commitf88abe5828bd9b07a0b4fe7b90b86810a0ce188c (patch)
treec418af8f9abe371540438b78a8b5cde96f22d41d
parent354374d772cc68e035f8306e54af0ba370a0a399 (diff)
trivionomicon: athena-bccr: add support for mirrors
-rw-r--r--trivionomicon/modules/athena-bccr/hm.nix7
-rw-r--r--trivionomicon/modules/athena-bccr/options.nix12
-rw-r--r--trivionomicon/modules/athena-bccr/sys.nix8
-rw-r--r--trivionomicon/pkgs/athena-bccr/default.nix3
-rw-r--r--trivionomicon/pkgs/athena-bccr/unwrapped.nix16
5 files changed, 41 insertions, 5 deletions
diff --git a/trivionomicon/modules/athena-bccr/hm.nix b/trivionomicon/modules/athena-bccr/hm.nix
index 0678e3c..df41f12 100644
--- a/trivionomicon/modules/athena-bccr/hm.nix
+++ b/trivionomicon/modules/athena-bccr/hm.nix
@@ -5,7 +5,12 @@
doctrine,
...
}: let
- athena = pkgs.${doctrine.prefix}.athena-bccr.${cfg.release};
+ athena =
+ (pkgs.${doctrine.prefix}.athena-bccr.override {
+ inherit (cfg) mirror;
+ }).${
+ cfg.release
+ };
in {
home.packages = [
athena.firmador
diff --git a/trivionomicon/modules/athena-bccr/options.nix b/trivionomicon/modules/athena-bccr/options.nix
index eb61cf5..7b6cf93 100644
--- a/trivionomicon/modules/athena-bccr/options.nix
+++ b/trivionomicon/modules/athena-bccr/options.nix
@@ -7,6 +7,12 @@ with lib.types; {
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";
@@ -21,6 +27,12 @@ with lib.types; {
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";
diff --git a/trivionomicon/modules/athena-bccr/sys.nix b/trivionomicon/modules/athena-bccr/sys.nix
index 98ae904..bd7d758 100644
--- a/trivionomicon/modules/athena-bccr/sys.nix
+++ b/trivionomicon/modules/athena-bccr/sys.nix
@@ -6,7 +6,13 @@
doctrine,
...
}: let
- athena = pkgs.${doctrine.prefix}.athena-bccr.${cfg.release};
+ athena =
+ (pkgs.${doctrine.prefix}.athena-bccr.override {
+ inherit (cfg) mirror;
+ }).${
+ cfg.release
+ };
+
inherit (athena) vendor;
driver = athena.card-driver.lib;
diff --git a/trivionomicon/pkgs/athena-bccr/default.nix b/trivionomicon/pkgs/athena-bccr/default.nix
index c4a8575..038220b 100644
--- a/trivionomicon/pkgs/athena-bccr/default.nix
+++ b/trivionomicon/pkgs/athena-bccr/default.nix
@@ -1,6 +1,7 @@
{
callPackage,
lib,
+ mirror ? null,
}: let
latest = "deb64-rev26.2";
@@ -18,7 +19,7 @@
pkgsForRelease = release: let
inherit (unwrapped) card-driver bccr-cacerts;
- unwrapped = overrideUnwrapped {inherit release;} {};
+ unwrapped = overrideUnwrapped {inherit mirror release;} {};
pkcs11-module = "${card-driver.lib}/${card-driver.pkcs11-path}";
in {
inherit card-driver bccr-cacerts pkcs11-module;
diff --git a/trivionomicon/pkgs/athena-bccr/unwrapped.nix b/trivionomicon/pkgs/athena-bccr/unwrapped.nix
index 3a70144..a2b7722 100644
--- a/trivionomicon/pkgs/athena-bccr/unwrapped.nix
+++ b/trivionomicon/pkgs/athena-bccr/unwrapped.nix
@@ -1,5 +1,7 @@
{
+ fetchurl,
lib,
+ mirror ? null,
requireFile,
release,
gaudiHash ? null,
@@ -7,10 +9,20 @@
}: let
inherit (release) srcPaths vendor;
- src = requireFile {
- url = "https://soportefirmadigital.com";
+ url =
+ if mirror != null
+ then "${mirror}/${release.filename}"
+ else "https://soportefirmadigital.com";
+
+ fetchSrc =
+ if mirror != null
+ then fetchurl
+ else requireFile;
+
+ src = fetchSrc {
name = release.filename;
+ inherit url;
inherit (release) hash;
};