mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-09 22:12:56 +00:00
f0e1fc740f
move misc data files to misc directory
20 lines
532 B
Nix
20 lines
532 B
Nix
{ pkgs, ... }: {
|
|
|
|
# nix run github:nmasur/dotfiles#encrypt-secret > private/mysecret.age
|
|
|
|
type = "app";
|
|
|
|
program = builtins.toString (pkgs.writeShellScript "encrypt-secret" ''
|
|
printf "\nEnter the secret data to encrypt for all hosts...\n\n" 1>&2
|
|
read -p "Secret: " secret
|
|
printf "\nEncrypting...\n\n" 1>&2
|
|
tmpfile=$(mktemp)
|
|
echo "''${secret}" > ''${tmpfile}
|
|
${pkgs.age}/bin/age --encrypt --armor --recipients-file ${
|
|
builtins.toString ../misc/public-keys
|
|
} $tmpfile
|
|
rm $tmpfile
|
|
'');
|
|
|
|
}
|