From c7d2e2d8668c57668eef3cd29a832489db1fe50b Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Wed, 14 Oct 2020 16:27:47 +0200 Subject: [PATCH] Write the unit config in a file --- garlic/stages/unit.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/garlic/stages/unit.nix b/garlic/stages/unit.nix index 2adb444..87650f8 100644 --- a/garlic/stages/unit.nix +++ b/garlic/stages/unit.nix @@ -1,6 +1,7 @@ { stdenv , bash +, writeText }: { @@ -35,6 +36,8 @@ let firstStage = (x: x.programPath) (elemAt linkStages 0); + + jsonConf = writeText "garlic_config.json" (builtins.toJSON conf); in stdenv.mkDerivation { name = "unit"; @@ -54,6 +57,9 @@ stdenv.mkDerivation { mkdir \$GARLIC_UNIT cd \$GARLIC_UNIT + # Copy the configuration for the unit to the output path + cp ${jsonConf} garlic_config.json + # Finally, execute the first stage: exec ${firstStage} EOF