nixops icon indicating copy to clipboard operation
nixops copied to clipboard

Global `deployment.keys.<name>.destDir`

Open kevincox opened this issue 4 years ago • 1 comments

deployment.storeKeysOnMachine was removed which means that the only real option is setting destDir for each key. Maybe that value can be restored with it just setting the default destDir for each key to /var/keys or similar? Or simple breaking compatibility and adding a deployment.defaultKeysDir?

kevincox avatar Jun 26 '21 11:06 kevincox

You can achieve this with type-merging, although a more obvious solution would be nice. Something like this should work:

# nixops network defaults. You could do it for a single host instead if you prefer.
defaults = { ... }: {
  # this is a nixos module
  options = {
    deployment.keys = lib.mkOption {
      # this gets merged into the existing type
      type = attrsOf (submodule ({ ... }: {
        config.destDir = "/run/nixops-keys";
      });
    };
  };
}

roberth avatar Mar 11 '22 11:03 roberth