mochi/.archive/modules/nixos/services/vault/default.nix

31 lines
693 B
Nix
Raw Normal View History

2024-09-10 13:43:35 -05:00
{ config, lib, pkgs, ... }:
let
2024-09-11 16:15:18 -05:00
cfg = config.mySystem.services.vault;
2024-09-10 13:43:35 -05:00
in
{
2024-09-11 16:15:18 -05:00
options.mySystem.services.vault = {
2024-09-10 13:43:35 -05:00
enable = lib.mkEnableOption "vault";
address = lib.mkOption {
type = lib.types.str;
default = "127.0.0.1:8200";
description = "Address of the Vault server";
example = "127.0.0.1:8200";
};
};
config = lib.mkIf cfg.enable {
services.vault = {
enable = true;
package = pkgs.unstable.vault;
address = cfg.address;
dev = false;
2024-09-11 16:15:18 -05:00
storageBackend = "raft";
extraConfig = ''
api_addr = "http://127.0.0.1:8200"
cluster_addr = "http://127.0.0.1:8201"
ui = true
'';
2024-09-10 13:43:35 -05:00
};
};
}