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

View File

@ -29,6 +29,9 @@ pkgs.stdenv.mkDerivation {
eval-config eval-config
Evaluate your node system configuration Evaluate your node system configuration
build-config
Build your node system on your local machine
generate-secrets generate-secrets
Create secrets required by your node configuration. Create secrets required by your node configuration.
Secrets are written to ./secrets/ Secrets are written to ./secrets/
@ -117,6 +120,13 @@ pkgs.stdenv.mkDerivation {
echo 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() { getNodeSystem() {
if [[ -e '${cfgDir}/krops/system' ]]; then if [[ -e '${cfgDir}/krops/system' ]]; then
echo -n "--argstr system "; cat '${cfgDir}/krops/system' echo -n "--argstr system "; cat '${cfgDir}/krops/system'