mlabs-haskell / spo-anywhere

Install Cardano nodes anywhere with the help of NixOS
https://mlabs-haskell.github.io/spo-anywhere/
Apache License 2.0
1 stars 0 forks source link

Scaffold a NixOS module able to produce a script #25

Closed aciceri closed 1 month ago

aciceri commented 4 months 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:

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.

zmrocze commented 4 months ago

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>).