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
|
|
|
{
|
2023-10-31 19:41:40 +02:00
|
|
|
imports = [
|
|
|
|
./options.nix
|
|
|
|
];
|
|
|
|
|
2023-07-05 21:53:04 +03:00
|
|
|
services.storage = {
|
2023-08-23 01:57:35 +03:00
|
|
|
nodes = {
|
|
|
|
external = [ "prophet" ];
|
|
|
|
heresy = [ "VEGAS" ];
|
2023-11-02 20:13:34 +02:00
|
|
|
garage = [ "prophet" "VEGAS" ];
|
2023-08-28 03:32:08 +03:00
|
|
|
garageInternal = [ "VEGAS" ];
|
2023-11-02 20:13:34 +02:00
|
|
|
garageExternal = [ "prophet" ];
|
2023-08-23 01:57:35 +03:00
|
|
|
};
|
|
|
|
nixos = {
|
|
|
|
external = [ ./external.nix ];
|
|
|
|
heresy = [ ./heresy.nix ];
|
2023-08-28 03:32:08 +03:00
|
|
|
garage = [
|
|
|
|
./garage.nix
|
2023-09-03 22:21:31 +03:00
|
|
|
./garage-options.nix
|
2023-08-28 03:32:08 +03:00
|
|
|
./garage-layout.nix
|
2023-10-31 19:41:40 +02:00
|
|
|
{
|
|
|
|
services.garage = {
|
|
|
|
inherit (config.garage) buckets keys;
|
|
|
|
};
|
|
|
|
}
|
2023-08-28 03:32:08 +03:00
|
|
|
];
|
|
|
|
garageInternal = [ ./garage-internal.nix ];
|
|
|
|
garageExternal = [ ./garage-external.nix ];
|
2023-08-23 01:57:35 +03:00
|
|
|
};
|
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;
|
|
|
|
};
|
|
|
|
});
|
2023-11-02 04:22:28 +02:00
|
|
|
|
|
|
|
garage = {
|
|
|
|
keys.storage-prophet = {};
|
|
|
|
buckets.storage-prophet = {
|
|
|
|
allow.storage-prophet = [ "read" "write" ];
|
|
|
|
};
|
|
|
|
};
|
2023-07-05 21:53:04 +03:00
|
|
|
}
|