makeShell: use actual system configuration in generate-secrets

This fixes a bug where the version update message for v0.0.65 is erroneously triggered
because the krops config is not included when evaluating secrets.
This commit is contained in:
Erik Arvstedt 2022-02-12 21:22:59 +01:00
parent 2e22bbdcc7
commit 1af84e8b7e
No known key found for this signature in database
GPG Key ID: 33312B944DD97846

View File

@ -77,7 +77,11 @@ pkgs.stdenv.mkDerivation {
generate-secrets() {( generate-secrets() {(
set -euo pipefail set -euo pipefail
genSecrets=$(nix-build --no-out-link -I nixos-config="${cfgDir}/configuration.nix" \ config="${cfgDir}/krops/krops-configuration.nix"
if [[ ! -e $config ]]; then
config="${cfgDir}/configuration.nix"
fi
genSecrets=$(nix-build --no-out-link -I nixos-config="$config" \
'<nixpkgs/nixos>' -A config.nix-bitcoin.generateSecretsScript) '<nixpkgs/nixos>' -A config.nix-bitcoin.generateSecretsScript)
mkdir -p "${cfgDir}/secrets" mkdir -p "${cfgDir}/secrets"
(cd "${cfgDir}/secrets"; $genSecrets) (cd "${cfgDir}/secrets"; $genSecrets)