mirror of
https://github.com/fort-nix/nix-bitcoin.git
synced 2024-11-22 22:33:46 +03:00
Add env for nix-shell which pins nixpkgs and automatically creates secrets
This commit is contained in:
parent
5e4e959e26
commit
d02749bc36
20
env.nix
Normal file
20
env.nix
Normal file
@ -0,0 +1,20 @@
|
||||
let
|
||||
# Pin nixpkgs
|
||||
nixpkgs = builtins.fetchGit {
|
||||
url = "https://github.com/nixos/nixpkgs-channels";
|
||||
ref = "nixos-18.09";
|
||||
rev = "0396345b79436f54920f7eb651ab42acf2eb7973";
|
||||
};
|
||||
in
|
||||
with import nixpkgs { };
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "nix-bitcoin-environment";
|
||||
|
||||
buildInputs = [ pkgs.nixops pkgs.figlet pkgs.apg ];
|
||||
|
||||
shellHook = ''
|
||||
figlet "nix-bitcoin"
|
||||
./secrets/generate_secrets.sh
|
||||
'';
|
||||
}
|
@ -1,15 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
SECRETSFILE=secrets/secrets.nix
|
||||
mkdir -p secrets
|
||||
|
||||
if [ -e "$SECRETSFILE" ]; then
|
||||
echo $SECRETSFILE already exists
|
||||
echo $SECRETSFILE already exists. No new secrets were generated.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo Installing apg through nix-env
|
||||
nix-env -i apg
|
||||
echo Write secrets to $SECRETSFILE
|
||||
{
|
||||
echo \{
|
Loading…
Reference in New Issue
Block a user