secrets: make configuration more robust

- Fail at evaluation when secrets setup is not configured.
  Previously, bitcoind failed at runtime due to the missing secrets target.

- Fail at evaluation when conflicting secrets setup methods are used.
  This happens when `secretsSetupMethod` has more than one definition.
This commit is contained in:
Erik Arvstedt
2021-03-15 12:42:52 +00:00
committed by Jonas Nick
parent b0c223e716
commit 55d87490ec
2 changed files with 19 additions and 1 deletions
+2
View File
@@ -1,5 +1,7 @@
{ config, ... }:
{
nix-bitcoin.secretsSetupMethod = "nixops";
deployment.keys = builtins.mapAttrs (n: v: {
keyFile = "${config.nix-bitcoin.deployment.secretsDir}/${n}";
destDir = config.nix-bitcoin.secretsDir;