From fa5c68b2a35fe745e7ec2ffeac862128b1fc4e29 Mon Sep 17 00:00:00 2001 From: kalipso Date: Wed, 22 Jan 2025 12:30:17 +0100 Subject: [PATCH] [vmBuilder] add writable store flag --- outputs.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/outputs.nix b/outputs.nix index 3c2433f..86be7f6 100644 --- a/outputs.nix +++ b/outputs.nix @@ -78,6 +78,7 @@ in (utils.lib.eachSystem (builtins.filter filter_system utils.lib.defaultSystems echo "--networking setup interfaces. requires root and hostbridge enabled on the host" echo "--dummy-secrets run vm with dummy sops secrets" echo "--no-disko disable disko and initrd secrets. needed for real hosts like fanny" + echo "--writable-store enables writable store. necessary for host with nested imperative microvms like fanny" echo "--var path to directory that should be shared as /var. may require root otherwise some systemd units fail within vm. if dir is empty vm will populate" exit 1 } @@ -93,6 +94,7 @@ in (utils.lib.eachSystem (builtins.filter filter_system utils.lib.defaultSystems NETWORK=false DUMMY_SECRETS=false NO_DISKO=false + RW_STORE=false VAR_PATH="" # check argws @@ -102,6 +104,7 @@ in (utils.lib.eachSystem (builtins.filter filter_system utils.lib.defaultSystems --networking) NETWORK=true ;; --dummy-secrets) DUMMY_SECRETS=true ;; --no-disko) NO_DISKO=true ;; + --writable-store) RW_STORE=true ;; --var) if [[ -n "$2" && ! "$2" =~ ^- ]]; then VAR_PATH="$2" @@ -119,11 +122,12 @@ in (utils.lib.eachSystem (builtins.filter filter_system utils.lib.defaultSystems echo "enable networking: $NETWORK" echo "deploy dummy secrets: $DUMMY_SECRETS" echo "disable disko and initrd secrets: $NO_DISKO" + echo "use writable store: $RW_STORE" if [ -n "$VAR_PATH" ]; then echo "sharing var directory: $VAR_PATH" fi - ${pkgs.nix}/bin/nix run --show-trace --impure --expr "((builtins.getFlake \"$(pwd)\").vmBuilder.x86_64-linux \"$HOSTNAME\" $NETWORK $DUMMY_SECRETS $NO_DISKO \"$VAR_PATH\")" + ${pkgs.nix}/bin/nix run --show-trace --impure --expr "((builtins.getFlake \"$(pwd)\").vmBuilder.x86_64-linux \"$HOSTNAME\" $NETWORK $DUMMY_SECRETS $NO_DISKO \"$VAR_PATH\" $RW_STORE).config.microvm.declaredRunner" ''; };