python312Packages.homematicip: 1.1.2 -> 1.1.3 (#356780)
[NixPkgs.git] / nixos / tests / garage / default.nix
blobb7f9bb4b865bdfa64e22feb1c0b7d712fd214595
1 { system ? builtins.currentSystem
2 , config ? { }
3 , pkgs ? import ../../.. { inherit system config; }
4 }:
5 with pkgs.lib;
7 let
8     mkNode = package: { replicationMode, publicV6Address ? "::1" }: { pkgs, ... }: {
9       networking.interfaces.eth1.ipv6.addresses = [{
10         address = publicV6Address;
11         prefixLength = 64;
12       }];
14       networking.firewall.allowedTCPPorts = [ 3901 3902 ];
16       services.garage = {
17         enable = true;
18         inherit package;
19         settings = {
20           replication_mode = replicationMode;
22           rpc_bind_addr = "[::]:3901";
23           rpc_public_addr = "[${publicV6Address}]:3901";
24           rpc_secret = "5c1915fa04d0b6739675c61bf5907eb0fe3d9c69850c83820f51b4d25d13868c";
26           s3_api = {
27             s3_region = "garage";
28             api_bind_addr = "[::]:3900";
29             root_domain = ".s3.garage";
30           };
32           s3_web = {
33             bind_addr = "[::]:3902";
34             root_domain = ".web.garage";
35             index = "index.html";
36           };
37         };
38       };
39       environment.systemPackages = [ pkgs.minio-client ];
41       # Garage requires at least 1GiB of free disk space to run.
42       virtualisation.diskSize = 2 * 1024;
43     };
45   foldl
46   (matrix: ver: matrix // {
47     "basic${toString ver}" = import ./basic.nix { inherit system pkgs ver; mkNode = mkNode pkgs."garage_${ver}"; };
48     "with-3node-replication${toString ver}" = import ./with-3node-replication.nix { inherit system pkgs ver; mkNode = mkNode pkgs."garage_${ver}"; };
49   })
50   {}
51   [
52     "0_8"
53     "0_9"
54     "1_x"
55   ]