Add env for nix-shell which pins nixpkgs and automatically creates secrets

This commit is contained in:
Jonas Nick
2019-01-01 20:17:07 +00:00
parent 5e4e959e26
commit d02749bc36
2 changed files with 21 additions and 3 deletions

20
secrets/generate_secrets.sh Executable file
View File

@@ -0,0 +1,20 @@
#!/bin/bash
SECRETSFILE=secrets/secrets.nix
if [ -e "$SECRETSFILE" ]; then
echo $SECRETSFILE already exists. No new secrets were generated.
exit 1
fi
echo Installing apg through nix-env
echo Write secrets to $SECRETSFILE
{
echo \{
echo " bitcoinrpcpassword = \"$(apg -m 20 -x 20 -M Ncl -n 1)\";"
echo " lightning-charge-api-token = \"$(apg -m 20 -x 20 -M Ncl -n 1)\";"
echo " liquidrpcpassword = \"$(apg -m 20 -x 20 -M Ncl -n 1)\";"
echo " spark-wallet-password = \"$(apg -m 20 -x 20 -M Ncl -n 1)\";"
echo \}
} >> $SECRETSFILE
echo Done