deployment shell: add command `build-config`

This commit is contained in:
Erik Arvstedt 2022-07-17 10:33:24 +02:00
parent 2926fc27dc
commit dad9679647
No known key found for this signature in database
GPG Key ID: 33312B944DD97846
1 changed files with 10 additions and 0 deletions

View File

@ -29,6 +29,9 @@ pkgs.stdenv.mkDerivation {
eval-config
Evaluate your node system configuration
build-config
Build your node system on your local machine
generate-secrets
Create secrets required by your node configuration.
Secrets are written to ./secrets/
@ -117,6 +120,13 @@ pkgs.stdenv.mkDerivation {
echo
)}
build-config() {(
set -euo pipefail
system=$(getNodeSystem)
NIXOS_CONFIG="${cfgDir}/krops/krops-configuration.nix" \
nix-build --no-out-link ${nixpkgs}/nixos $system -A system
)}
getNodeSystem() {
if [[ -e '${cfgDir}/krops/system' ]]; then
echo -n "--argstr system "; cat '${cfgDir}/krops/system'