Compare commits
No commits in common. "26f1fa436a662baa59a4717138dbfb14c5d48911" and "789b1780cb5f3b309497466bf73e1389c281cc13" have entirely different histories.
26f1fa436a
...
789b1780cb
5 changed files with 19 additions and 61 deletions
|
|
@ -5,12 +5,7 @@
|
||||||
doctrine,
|
doctrine,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
athena =
|
athena = pkgs.${doctrine.prefix}.athena-bccr.${cfg.release};
|
||||||
(pkgs.${doctrine.prefix}.athena-bccr.override {
|
|
||||||
inherit (cfg) mirror;
|
|
||||||
}).${
|
|
||||||
cfg.release
|
|
||||||
};
|
|
||||||
in {
|
in {
|
||||||
home.packages = [
|
home.packages = [
|
||||||
athena.firmador
|
athena.firmador
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,6 @@ 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";
|
||||||
|
|
@ -27,12 +21,6 @@ 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";
|
||||||
|
|
|
||||||
|
|
@ -6,13 +6,7 @@
|
||||||
doctrine,
|
doctrine,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
athena =
|
athena = pkgs.${doctrine.prefix}.athena-bccr.${cfg.release};
|
||||||
(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;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
{
|
{
|
||||||
callPackage,
|
callPackage,
|
||||||
lib,
|
lib,
|
||||||
mirror ? null,
|
|
||||||
}: let
|
}: let
|
||||||
latest = "deb64-rev26.2";
|
latest = "deb64-rev26.2";
|
||||||
|
|
||||||
|
|
@ -19,7 +18,7 @@
|
||||||
pkgsForRelease = release: let
|
pkgsForRelease = release: let
|
||||||
inherit (unwrapped) card-driver bccr-cacerts;
|
inherit (unwrapped) card-driver bccr-cacerts;
|
||||||
|
|
||||||
unwrapped = overrideUnwrapped {inherit mirror release;} {};
|
unwrapped = overrideUnwrapped {inherit 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;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
{
|
{
|
||||||
fetchurl,
|
|
||||||
lib,
|
lib,
|
||||||
mirror ? null,
|
|
||||||
requireFile,
|
requireFile,
|
||||||
release,
|
release,
|
||||||
gaudiHash ? null,
|
gaudiHash ? null,
|
||||||
|
|
@ -9,32 +7,20 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (release) srcPaths vendor;
|
inherit (release) srcPaths vendor;
|
||||||
|
|
||||||
url =
|
src = requireFile {
|
||||||
if mirror != null
|
url = "https://soportefirmadigital.com";
|
||||||
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;
|
||||||
};
|
};
|
||||||
|
|
||||||
gaudiUpdateSrc = {
|
gaudiUpdateSrc = {update-gaudi}:
|
||||||
update-gaudi,
|
requireFile {
|
||||||
runCommand,
|
url = "${update-gaudi}";
|
||||||
}:
|
name = "gaudi-update-${release.name}.zip";
|
||||||
runCommand "gaudi-update-${release.name}.zip" {
|
|
||||||
outputHash = gaudiHash;
|
hash = gaudiHash;
|
||||||
} ''
|
};
|
||||||
${update-gaudi} $out
|
|
||||||
'';
|
|
||||||
|
|
||||||
moduleFromDeb = name: args @ {
|
moduleFromDeb = name: args @ {
|
||||||
stdenv,
|
stdenv,
|
||||||
|
|
@ -190,7 +176,6 @@ in
|
||||||
pkgs,
|
pkgs,
|
||||||
stdenv,
|
stdenv,
|
||||||
unzip,
|
unzip,
|
||||||
runCommand,
|
|
||||||
writeShellScriptBin,
|
writeShellScriptBin,
|
||||||
update-gaudi,
|
update-gaudi,
|
||||||
...
|
...
|
||||||
|
|
@ -201,7 +186,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
fakeSudo = writeShellScriptBin "sudo" "";
|
fakeSudo = writeShellScriptBin "sudo" "";
|
||||||
gaudiUpdate = gaudiUpdateSrc {inherit runCommand update-gaudi;};
|
gaudiUpdate = gaudiUpdateSrc {inherit update-gaudi;};
|
||||||
in
|
in
|
||||||
moduleFromDeb "gaudi" {
|
moduleFromDeb "gaudi" {
|
||||||
inherit dpkg stdenv unzip;
|
inherit dpkg stdenv unzip;
|
||||||
|
|
@ -303,20 +288,17 @@ in
|
||||||
wget --ca-certificate="$ca_cert" "$base_url/bccr-firma-fva-clienteMultiplataforma.jar"
|
wget --ca-certificate="$ca_cert" "$base_url/bccr-firma-fva-clienteMultiplataforma.jar"
|
||||||
wget --ca-certificate="$ca_cert" "$base_url/ServicioActualizadorClienteBCCR.jar"
|
wget --ca-certificate="$ca_cert" "$base_url/ServicioActualizadorClienteBCCR.jar"
|
||||||
|
|
||||||
if [ -n "$1" ]; then
|
|
||||||
zip_path="$1"
|
|
||||||
else
|
|
||||||
zip_path="$PWD/gaudi-update-${release.name}.zip"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# https://gist.github.com/stokito/c588b8d6a6a0aee211393d68eea678f2
|
# https://gist.github.com/stokito/c588b8d6a6a0aee211393d68eea678f2
|
||||||
TZ=UTC find . -exec touch --no-dereference -a -m -t 198002010000.00 {} +
|
TZ=UTC find . -exec touch --no-dereference -a -m -t 198002010000.00 {} +
|
||||||
|
zip_path="$PWD/gaudi-update-${release.name}.zip"
|
||||||
TZ=UTC zip -q --move --recurse-paths --symlinks -X "$zip_path" .
|
TZ=UTC zip -q --move --recurse-paths --symlinks -X "$zip_path" .
|
||||||
TZ=UTC touch -a -m -t 198002010000.00 "$zip_path"
|
TZ=UTC touch -a -m -t 198002010000.00 "$zip_path"
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
set -x
|
||||||
|
nix-store --add-fixed sha256 "$zip_path"
|
||||||
|
set +x
|
||||||
|
|
||||||
echo -e "\ngaudiHash: $(nix-hash --to-sri --type sha256 $(sha256sum "$zip_path" | cut -d' ' -f1))"
|
echo -e "\ngaudiHash: $(nix-hash --to-sri --type sha256 $(sha256sum "$zip_path" | cut -d' ' -f1))"
|
||||||
fi
|
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
// lib.optionalAttrs (vendor == "athena") {
|
// lib.optionalAttrs (vendor == "athena") {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue