derived-secrets: fix broken encoding
This commit is contained in:
parent
db72f5e11f
commit
640d9be83d
|
@ -40,6 +40,7 @@ in
|
|||
generated.command = [
|
||||
"${hash-path-with-salt}/bin/hash-path-with-salt"
|
||||
path
|
||||
c.encoding
|
||||
];
|
||||
generated.acl.mode = "0600";
|
||||
}) cfg;
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash
|
||||
echo "$1" | cat /dev/stdin /etc/ssh/host_keys/ssh_host_ed25519_key \
|
||||
file="$1"
|
||||
enc="$2"
|
||||
echo "$file" | cat /dev/stdin /etc/ssh/host_keys/ssh_host_ed25519_key \
|
||||
| sha512sum \
|
||||
| cut -c 1-${toString (c.len * 2)} \
|
||||
| tr a-z A-Z \
|
||||
| basenc -d --base16 \
|
||||
| basenc --${c.encoding} \
|
||||
> "$1"
|
||||
| basenc "--$enc" \
|
||||
> "$file"
|
||||
|
|
Loading…
Reference in New Issue
Block a user