From 6bc7549b1addfffa41024083e99846a472c3ffc3 Mon Sep 17 00:00:00 2001 From: Kiara Grouwstra Date: Thu, 17 Apr 2025 18:11:03 +0200 Subject: [PATCH] consolidate setup in script --- launch/README.md | 16 ++++------------ launch/default.nix | 6 ++++++ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/launch/README.md b/launch/README.md index af8ed851..2d1a9fd3 100644 --- a/launch/README.md +++ b/launch/README.md @@ -2,22 +2,14 @@ ## usage -<-- TODO: port to just --> - -### updating npins +before using other commands, if not using direnv: ```sh -$ cd launch/ -$ echo "$(nix eval --json -f ../npins)" > .npins.json +nix-shell ``` -### local development +then to initialize, or after updating pins or TF providers: ```sh -$ nix-shell -$ eval "$(ssh-agent -s)" -# set your ssh key, e.g.: -$ ssh_key="$(readlink -f ~/.ssh/id_ed25519)" -$ rm -rf .terraform/ -$ tofu init +init-env ``` diff --git a/launch/default.nix b/launch/default.nix index 139b4300..b1700481 100644 --- a/launch/default.nix +++ b/launch/default.nix @@ -12,6 +12,11 @@ }: let inherit (pkgs) lib; + setup = pkgs.writeScriptBin "setup" '' + echo '${lib.strings.toJSON sources}' > .npins.json + rm -rf .terraform/ + tofu init + ''; in { # shell for testing TF directly @@ -19,6 +24,7 @@ in packages = [ (import ./tf.nix { inherit lib pkgs; }) pkgs.jaq + setup ]; };