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