add generate-secrets pkg

generate-secrets.sh will also be used in generate-secrets.nix, so DRY
its dependency definitions.
This commit is contained in:
Erik Arvstedt 2019-11-27 14:04:31 +01:00
parent e34093a8ac
commit 6447694214
No known key found for this signature in database
GPG Key ID: 33312B944DD97846
5 changed files with 10 additions and 2 deletions

View File

@ -9,4 +9,5 @@
hwi = pkgs.callPackage ./hwi { }; hwi = pkgs.callPackage ./hwi { };
pylightning = pkgs.python3Packages.callPackage ./pylightning { }; pylightning = pkgs.python3Packages.callPackage ./pylightning { };
liquid-swap = pkgs.python3Packages.callPackage ./liquid-swap { }; liquid-swap = pkgs.python3Packages.callPackage ./liquid-swap { };
generate-secrets = pkgs.callPackage ./generate-secrets { };
} }

View File

@ -0,0 +1,6 @@
{ pkgs }: with pkgs;
writeScript "generate-secrets" ''
export PATH=${lib.makeBinPath [ coreutils apg openssl ]}
. ${./generate-secrets.sh} ${./openssl.cnf}
''

View File

@ -7,8 +7,9 @@ stdenv.mkDerivation rec {
name = "nix-bitcoin-environment"; name = "nix-bitcoin-environment";
nixops19_09 = callPackage ./pkgs/nixops {}; nixops19_09 = callPackage ./pkgs/nixops {};
generate-secrets = callPackage ./pkgs/generate-secrets {};
buildInputs = with pkgs; [ nixops19_09 figlet apg openssl ]; buildInputs = [ nixops19_09 figlet ];
shellHook = '' shellHook = ''
export NIX_PATH="nixpkgs=${nixpkgs}:." export NIX_PATH="nixpkgs=${nixpkgs}:."
@ -18,6 +19,6 @@ stdenv.mkDerivation rec {
# keys already added to my ssh-agent. # keys already added to my ssh-agent.
export SSH_AUTH_SOCK="" export SSH_AUTH_SOCK=""
figlet "nix-bitcoin" figlet "nix-bitcoin"
(cd secrets; ./generate_secrets.sh) (mkdir -p secrets; cd secrets; ${generate-secrets})
''; '';
} }