cute refactor
This commit is contained in:
parent
3e9d95c2a3
commit
7fb32811d4
12 changed files with 252 additions and 181 deletions
50
modules/garage/default.nix
Normal file
50
modules/garage/default.nix
Normal file
|
@ -0,0 +1,50 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.garage;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
modules = {
|
||||
garage = {
|
||||
enable = mkEnableOption "Deploy garage";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.garage = {
|
||||
enable = true;
|
||||
package = pkgs.garage;
|
||||
settings = {
|
||||
metadata_dir = "/garage/metadata";
|
||||
data_dir = "/garage/data";
|
||||
db_engine = "lmdb";
|
||||
replication_mode = "2";
|
||||
rpc_bind_addr = "[::]:3901";
|
||||
rpc_public_addr = "${config.networking.hostName}:3901";
|
||||
rpc_secret_file = config.age.secrets."garage-rpc-secret".path;
|
||||
s3_api = {
|
||||
s3_region = config.networking.hostName;
|
||||
api_bind_addr = "[::]:3900";
|
||||
root_domain = ".s3.nekomimi.pet";
|
||||
};
|
||||
s3_web = {
|
||||
bind_addr = "[::]:3902";
|
||||
root_domain = ".web.nekomimi.pet";
|
||||
index = "index.html";
|
||||
};
|
||||
admin = {
|
||||
api_bind_addr = "[::]:3903";
|
||||
admin_token_file = config.age.secrets."garage-admin-token".path;
|
||||
metrics_token_file = config.age.secrets."garage-metrics-token".path;
|
||||
};
|
||||
bootstrap_peers = [
|
||||
"d548d0c9ae9aec9e26fe0bd2ca3efe75f654fa350bad5cb02bc9aebc9850ba8f@[2a04:52c0:135:48d1::2]:3901" # buer
|
||||
"5504cb25910dcef4a4312006691d651c099cde7c3a88df9ca79aa350571e6e65@[2601:5c2:8400:26c0:4ecc:6aff:fef7:98ca]:3901" #valefar
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue