From 746ea42ff4616024ec41b6dcb1d2588dee4b85d1 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Fri, 18 Oct 2024 21:56:16 +0200 Subject: refactor(modules/legacy/conf/lf): Move to new `by-name` dir This makes it possible to mix and match between `NixOS` and `home-manager` options and thus allows merging the secret handling directly into this module. Furthermore, the `systemd` tempfiles handling was also merged into this module. --- modules/by-name/se/secrets/update_secrets.sh | 37 ---------------------------- 1 file changed, 37 deletions(-) delete mode 100755 modules/by-name/se/secrets/update_secrets.sh (limited to 'modules/by-name/se/secrets/update_secrets.sh') diff --git a/modules/by-name/se/secrets/update_secrets.sh b/modules/by-name/se/secrets/update_secrets.sh deleted file mode 100755 index f1c27d77..00000000 --- a/modules/by-name/se/secrets/update_secrets.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env nix -#! nix shell nixpkgs#age nixpkgs#jq nixpkgs#dash --command dash -# shellcheck shell=dash - -cleanup() { - [ "$key_file" ] && rm "$key_file" -} -trap cleanup EXIT - -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" - - # `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 - - echo "Finished updating the lf/cd_paths.age file.." -} - -main() { - update_lf_cd_paths -} - -main - -# vim: ft=sh -- cgit 1.4.1