Closed aciceri closed 1 month ago
The idea is that given a NixOS module like
{ imports = [spo-anywhere.nixosModules.spo-anywhere]; spo-anywhere = { blockProducer = { # ... }; target = "X.X.X.X"; };
we get a derivation in the NixOS configuration attrset that depends on those options. For instance running nix build .#nixosConfigurations.foo.config.system.build.spoAnywhereScript we should get a bash script that runs:
nix build .#nixosConfigurations.foo.config.system.build.spoAnywhereScript
nixos-anywhere --flake /nix/store/.../foo-config-flake#foo --target X.X.X.X scp -r $1 X.X.X.X:/var/lib/mykeys
For this issue purposes let's focus only on the structure and let's merge it as soon as it works.
I made target an argument of the script in the same way that key-dir is (i.e. Usage: spo-deploy-script --target <target> --key-dir <key-dir>).
target
key-dir
Usage: spo-deploy-script --target <target> --key-dir <key-dir>
The idea is that given a NixOS module like
we get a derivation in the NixOS configuration attrset that depends on those options. For instance running
nix build .#nixosConfigurations.foo.config.system.build.spoAnywhereScript
we should get a bash script that runs:For this issue purposes let's focus only on the structure and let's merge it as soon as it works.