feat(agent): further adapt to openbao

Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
main
Raito Bezarius 1 month ago
parent 5aa5a794fd
commit 8be31345fa

@ -4,7 +4,7 @@
, ...
}:
let
cfg = config.services.vault;
cfg = config.services.openbao;
settingsFormat = pkgs.formats.json { };
autoAuthMethodModule = lib.types.submodule {
@ -60,9 +60,9 @@ let
};
in
{
options.services.vault.agents = lib.mkOption {
options.services.openbao.agents = lib.mkOption {
default = { };
description = "Instances of vault agent";
description = "Instances of openbao agent";
type = lib.types.attrsOf (lib.types.submodule {
options = {
settings = lib.mkOption {
@ -75,7 +75,7 @@ in
config = {
systemd.services = lib.mapAttrs'
(name: instanceCfg:
lib.nameValuePair "vault-agent-${name}" {
lib.nameValuePair "openbao-agent-${name}" {
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
@ -87,7 +87,8 @@ in
path = [ pkgs.getent ];
serviceConfig = {
Restart = "on-failure";
ExecStart = "${pkgs.vault}/bin/vault agent -config=${settingsFormat.generate "agent.json" instanceCfg.settings}";
# TODO: cfg.package
ExecStart = "${lib.getExe pkgs.openbao} agent -config=${settingsFormat.generate "agent.json" instanceCfg.settings}";
};
})
cfg.agents;
Loading…
Cancel
Save