diff options
Diffstat (limited to '')
-rw-r--r-- | modules/by-name/lf/lf/secrets/cd_paths.age (renamed from modules/by-name/se/secrets/lf/cd_paths.age) | 0 | ||||
-rwxr-xr-x | modules/by-name/lf/lf/secrets/update_secret.sh (renamed from modules/by-name/se/secrets/update_secrets.sh) | 18 |
2 files changed, 6 insertions, 12 deletions
diff --git a/modules/by-name/se/secrets/lf/cd_paths.age b/modules/by-name/lf/lf/secrets/cd_paths.age index 3b018fb7..3b018fb7 100644 --- a/modules/by-name/se/secrets/lf/cd_paths.age +++ b/modules/by-name/lf/lf/secrets/cd_paths.age diff --git a/modules/by-name/se/secrets/update_secrets.sh b/modules/by-name/lf/lf/secrets/update_secret.sh index f1c27d77..b29fdb86 100755 --- a/modules/by-name/se/secrets/update_secrets.sh +++ b/modules/by-name/lf/lf/secrets/update_secret.sh @@ -7,31 +7,25 @@ cleanup() { } trap cleanup EXIT +root="$(git rev-parse --show-toplevel)" +output_file="$(dirname "$0")/cd_paths.age" + update_lf_cd_paths() { echo "Starting to update the lf/cd_paths.age file.." - cd "$(git rev-parse --show-toplevel)/modules/system/secrets" || { - echo "A secrets dir does not exist! (This is most likely a bug)" - exit 1 - } - key_file="$(mktemp)" - nix eval -f ./secrets.nix --json | jq --raw-output '.["lf/cd_paths.age"].publicKeys | join("\n")' >"$key_file" + nix eval -f "$root/secrets.nix" --json | jq --raw-output '.["modules/by-name/lf/lf/secrets/cd_paths.age"].publicKeys | join("\n")' >"$key_file" # `lf-make-map` is provided by the dev shell { lf-make-map --quiet --depth 4 visualize ~/media ~/repos ~/school | sed 's|\(.*\)|# \1|' lf-make-map --quiet --depth 4 generate ~/media ~/repos ~/school - } | age --recipients-file "$key_file" --encrypt --armor --output ./lf/cd_paths.age + } | age --recipients-file "$key_file" --encrypt --armor --output "$output_file" echo "Finished updating the lf/cd_paths.age file.." } -main() { - update_lf_cd_paths -} - -main +update_lf_cd_paths # vim: ft=sh |