add garage instance
This commit is contained in:
@@ -5,9 +5,15 @@
|
|||||||
inventory.machines = {
|
inventory.machines = {
|
||||||
crocus = {
|
crocus = {
|
||||||
deploy.targetHost = "root@crocus";
|
deploy.targetHost = "root@crocus";
|
||||||
|
tags = [
|
||||||
|
"garage"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
genepi = {
|
genepi = {
|
||||||
deploy.targetHost = "root@genepi";
|
deploy.targetHost = "root@genepi";
|
||||||
|
tags = [
|
||||||
|
"garage"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -78,6 +84,19 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
"garage" = {
|
||||||
|
module.input = "clan-core";
|
||||||
|
module.name = "garage";
|
||||||
|
roles.default.tags.garage = { };
|
||||||
|
};
|
||||||
|
|
||||||
|
"garage-config" = {
|
||||||
|
module.input = "clan-core";
|
||||||
|
module.name = "importer";
|
||||||
|
roles.default.tags.garage = { };
|
||||||
|
roles.default.extraModules = [ ../modules/garage.nix ];
|
||||||
|
};
|
||||||
|
|
||||||
"trusted-nix-caches" = {
|
"trusted-nix-caches" = {
|
||||||
module.input = "clan-core";
|
module.input = "clan-core";
|
||||||
module.name = "trusted-nix-caches";
|
module.name = "trusted-nix-caches";
|
||||||
|
|||||||
44
modules/garage.nix
Normal file
44
modules/garage.nix
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
self,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
zerotier_interface = "zts7mq7onf";
|
||||||
|
zerotier_ip =
|
||||||
|
self.nixosConfigurations.${config.networking.hostName}.config.clan.core.vars.generators.zerotier.files.zerotier-ip.value;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
services.garage = {
|
||||||
|
package = pkgs.garage;
|
||||||
|
settings = {
|
||||||
|
metadata_dir = "/var/lib/garage/meta";
|
||||||
|
data_dir = "/var/lib/garage/data";
|
||||||
|
db_engine = "sqlite";
|
||||||
|
|
||||||
|
replication_factor = 2;
|
||||||
|
|
||||||
|
rpc_bind_addr = "[${zerotier_ip}]:3901";
|
||||||
|
|
||||||
|
s3_api = {
|
||||||
|
api_bind_addr = "127.0.0.1:3900";
|
||||||
|
s3_region = "garage";
|
||||||
|
root_domain = ".s3.garage.home.rpqt.fr";
|
||||||
|
};
|
||||||
|
|
||||||
|
s3_web = {
|
||||||
|
bind_addr = "127.0.0.1:3902";
|
||||||
|
root_domain = ".web.garage.home.rpqt.fr";
|
||||||
|
};
|
||||||
|
|
||||||
|
admin = {
|
||||||
|
api_bind_addr = "127.0.0.1:3903";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.firewall.interfaces.${zerotier_interface} = {
|
||||||
|
allowedTCPPorts = [ 3901 ];
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user