add some commands to read secret
values
This commit is contained in:
parent
334c0b54cc
commit
e92f2cf82c
2 changed files with 9 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
|||
base_path := invocation_directory() / "systems/x86_64-linux"
|
||||
sops := "nix shell nixpkgs#sops --command sops"
|
||||
yq := "nix shell nixpkgs#yq --command yq"
|
||||
|
||||
@_default:
|
||||
just --list
|
||||
|
|
@ -19,6 +20,9 @@ list machine:
|
|||
|
||||
echo "Done"
|
||||
|
||||
@get machine key:
|
||||
{{ sops }} decrypt {{ base_path }}/{{ machine }}/secrets.yml | {{ yq }} ".$(echo "{{ key }}" | sed -E 's/\//./g')"
|
||||
|
||||
@remove machine key:
|
||||
{{ sops }} unset {{ base_path }}/{{ machine }}/secrets.yml "$(printf '%s\n' '["{{ key }}"]' | sed -E 's#/#"]["#g; s/\["([0-9]+)"\]/[\1]/g')"
|
||||
|
||||
|
|
|
|||
|
|
@ -15,4 +15,8 @@ mod machine '.just/machine.just'
|
|||
@update:
|
||||
nix flake update
|
||||
git commit -m 'chore: update dependencies' -- ./flake.lock > /dev/null
|
||||
echo "Done"
|
||||
echo "Done"
|
||||
|
||||
[doc('Introspection on flake output')]
|
||||
@select key:
|
||||
nix eval --json .#{{ key }} | jq .
|
||||
Loading…
Add table
Add a link
Reference in a new issue