1{
2 runTest,
3 package,
4}:
5let
6 mkNode =
7 {
8 publicV6Address ? "::1",
9 extraSettings ? { },
10 }:
11 { pkgs, ... }:
12 {
13 networking.interfaces.eth1.ipv6.addresses = [
14 {
15 address = publicV6Address;
16 prefixLength = 64;
17 }
18 ];
19
20 networking.firewall.allowedTCPPorts = [
21 3901
22 3902
23 ];
24
25 services.garage = {
26 enable = true;
27 inherit package;
28 settings = {
29 rpc_bind_addr = "[::]:3901";
30 rpc_public_addr = "[${publicV6Address}]:3901";
31 rpc_secret = "5c1915fa04d0b6739675c61bf5907eb0fe3d9c69850c83820f51b4d25d13868c";
32
33 s3_api = {
34 s3_region = "garage";
35 api_bind_addr = "[::]:3900";
36 root_domain = ".s3.garage";
37 };
38
39 s3_web = {
40 bind_addr = "[::]:3902";
41 root_domain = ".web.garage";
42 index = "index.html";
43 };
44 }
45 // extraSettings;
46 };
47 environment.systemPackages = [ pkgs.minio-client ];
48
49 # Garage requires at least 1GiB of free disk space to run.
50 virtualisation.diskSize = 2 * 1024;
51 };
52in
53{
54 basic = runTest {
55 imports = [
56 ./common.nix
57 ./basic.nix
58 ];
59 _module.args = {
60 inherit mkNode package;
61 };
62 };
63
64 with-3node-replication = runTest {
65 imports = [
66 ./common.nix
67 ./with-3node-replication.nix
68 ];
69 _module.args = {
70 inherit mkNode package;
71 };
72 };
73}