depot/cluster/services/storage/default.nix

58 lines
1.2 KiB
Nix
Raw Normal View History

2023-08-28 03:32:08 +03:00
{ config, lib, ... }:
let
meshIpForNode = name: config.vars.mesh.${name}.meshIp;
in
2023-07-05 21:53:04 +03:00
{
imports = [
./options.nix
];
2023-07-05 21:53:04 +03:00
services.storage = {
nodes = {
external = [ "prophet" ];
heresy = [ "VEGAS" ];
garage = [ "prophet" "VEGAS" ];
2023-08-28 03:32:08 +03:00
garageInternal = [ "VEGAS" ];
garageExternal = [ "prophet" ];
};
nixos = {
external = [ ./external.nix ];
heresy = [ ./heresy.nix ];
2023-08-28 03:32:08 +03:00
garage = [
./garage.nix
./garage-options.nix
2023-08-28 03:32:08 +03:00
./garage-layout.nix
./garage-gateway.nix
{
services.garage = {
inherit (config.garage) buckets keys;
};
}
2023-08-28 03:32:08 +03:00
];
garageInternal = [ ./garage-internal.nix ];
garageExternal = [ ./garage-external.nix ];
};
2023-07-05 21:53:04 +03:00
};
2023-08-28 03:32:08 +03:00
hostLinks = lib.genAttrs config.services.storage.nodes.garage (name: {
garageRpc = {
ipv4 = meshIpForNode name;
};
garageS3 = {
protocol = "http";
ipv4 = meshIpForNode name;
};
});
garage = {
keys.storage-prophet = {};
buckets.storage-prophet = {
allow.storage-prophet = [ "read" "write" ];
};
};
dns.records.garage.consulService = "garage";
2023-07-05 21:53:04 +03:00
}