summaryrefslogtreecommitdiff
path: root/pkgs/athena-bccr/gaudi-env.nix
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2025-08-24 18:55:06 -0600
committerAlejandro Soto <alejandro@34project.org>2025-08-24 18:55:06 -0600
commitd7ac88762db111a7962c4e14b5f4e37ab85ccac7 (patch)
tree0c2c8c4383bef74215e3b7c48a2f6b0117f084bc /pkgs/athena-bccr/gaudi-env.nix
parent504589d1035f27b766bd33040b415b2725ece4ca (diff)
tree-wide: reformat using alejandra after enabling trivionomicon
Diffstat (limited to 'pkgs/athena-bccr/gaudi-env.nix')
-rw-r--r--pkgs/athena-bccr/gaudi-env.nix97
1 files changed, 48 insertions, 49 deletions
diff --git a/pkgs/athena-bccr/gaudi-env.nix b/pkgs/athena-bccr/gaudi-env.nix
index 1ced54e..0ca1b82 100644
--- a/pkgs/athena-bccr/gaudi-env.nix
+++ b/pkgs/athena-bccr/gaudi-env.nix
@@ -1,63 +1,62 @@
-{ buildFHSEnv
-, curl
-, lib
-, writeShellScriptBin
-
-, gaudiHash ? null
-, unwrapped
-}:
-let
- unwrappedWithGaudi = unwrapped.override { inherit gaudiHash; };
+{
+ buildFHSEnv,
+ curl,
+ lib,
+ writeShellScriptBin,
+ gaudiHash ? null,
+ unwrapped,
+}: let
+ unwrappedWithGaudi = unwrapped.override {inherit gaudiHash;};
in
-buildFHSEnv {
- name = "gaudi";
+ buildFHSEnv {
+ name = "gaudi";
- targetPkgs = pkgs: [
- unwrappedWithGaudi.ase-idprotect.lib
- unwrappedWithGaudi.gaudi
+ targetPkgs = pkgs: [
+ unwrappedWithGaudi.ase-idprotect.lib
+ unwrappedWithGaudi.gaudi
- (writeShellScriptBin "launch-gaudi" ''
- set -o errexit
- set -o pipefail
- set -o nounset
+ (writeShellScriptBin "launch-gaudi" ''
+ set -o errexit
+ set -o pipefail
+ set -o nounset
- PATH="${lib.makeBinPath [ curl ]}:$PATH"
+ PATH="${lib.makeBinPath [curl]}:$PATH"
- echo "$0: testing for incompatible releases..." >&2
+ echo "$0: testing for incompatible releases..." >&2
- jar_name=bccr-firma-fva-clienteMultiplataforma.jar
- url="https://www.firmadigital.go.cr/Bccr.Firma.Fva.Actualizador.ClienteFirmadorJava//recursosLiberica17/actualizador/$jar_name"
- ca_file="${unwrappedWithGaudi.bccr-cacerts}/root-ca.pem"
- url_hash=$(curl -sS --cacert "$ca_file" "$url" | sha256sum | cut -d' ' -f1)
- jar_path="${unwrappedWithGaudi.gaudi}/share/java/$jar_name"
- jar_hash=$(sha256sum "$jar_path" | cut -d' ' -f1)
+ jar_name=bccr-firma-fva-clienteMultiplataforma.jar
+ url="https://www.firmadigital.go.cr/Bccr.Firma.Fva.Actualizador.ClienteFirmadorJava//recursosLiberica17/actualizador/$jar_name"
+ ca_file="${unwrappedWithGaudi.bccr-cacerts}/root-ca.pem"
+ url_hash=$(curl -sS --cacert "$ca_file" "$url" | sha256sum | cut -d' ' -f1)
+ jar_path="${unwrappedWithGaudi.gaudi}/share/java/$jar_name"
+ jar_hash=$(sha256sum "$jar_path" | cut -d' ' -f1)
- if [ "$url_hash" != "$jar_hash" ]; then
- last_modified=$(curl -sS --head --cacert "$ca_file" "$url" | grep -i '^last-modified:' | head -1)
+ if [ "$url_hash" != "$jar_hash" ]; then
+ last_modified=$(curl -sS --head --cacert "$ca_file" "$url" | grep -i '^last-modified:' | head -1)
- echo "$0: sha256 mismatch for $jar_path due to server-side update" >&2
- echo "$0: expected: $url_hash" >&2
- echo "$0: actual: $jar_hash" >&2
- echo "$0: $last_modified" >&2
- echo "$0: run the following to download the new client JAR, then update your derivation:" >&2
- echo "$0: \$ ${unwrappedWithGaudi.update-gaudi}" >&2
+ echo "$0: sha256 mismatch for $jar_path due to server-side update" >&2
+ echo "$0: expected: $url_hash" >&2
+ echo "$0: actual: $jar_hash" >&2
+ echo "$0: $last_modified" >&2
+ echo "$0: run the following to download the new client JAR, then update your derivation:" >&2
+ echo "$0: \$ ${unwrappedWithGaudi.update-gaudi}" >&2
- exit 1
- fi
+ exit 1
+ fi
- cache_path_1="''${XDG_CACHE_HOME:-$HOME/.cache}/Agente-GAUDI"
- cache_path_2="''${XDG_CACHE_HOME:-$HOME/.cache}/Firmador-BCCR"
+ cache_path_1="''${XDG_CACHE_HOME:-$HOME/.cache}/Agente-GAUDI"
+ cache_path_2="''${XDG_CACHE_HOME:-$HOME/.cache}/Firmador-BCCR"
- for cache_path in "$cache_path_1" "$cache_path_2"; do
- mkdir -p "$cache_path"
- ln -sf -- ${unwrappedWithGaudi.gaudi}/share/java/bccr-firma-fva-clienteMultiplataforma.jar "$cache_path"
- done
+ for cache_path in "$cache_path_1" "$cache_path_2"; do
+ mkdir -p "$cache_path"
+ ln -sf -- ${unwrappedWithGaudi.gaudi}/share/java/bccr-firma-fva-clienteMultiplataforma.jar "$cache_path"
+ done
- cp -f --no-preserve=mode -t "$cache_path_1" -- "${unwrappedWithGaudi.gaudi}/share/java/config.properties"
+ cp -f --no-preserve=mode -t "$cache_path_1" -- "${unwrappedWithGaudi.gaudi}/share/java/config.properties"
- exec gaudi
- '')
- ];
+ exec gaudi
+ '')
+ ];
- runScript = "launch-gaudi";
-}
+ runScript = "launch-gaudi";
+ }