consolidate setup in script

This commit is contained in:
Kiara Grouwstra 2025-04-17 18:11:03 +02:00
parent e6b06c86a6
commit 6bc7549b1a
2 changed files with 10 additions and 12 deletions

View file

@ -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
```

View file

@ -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
];
};