bring back garage
make it work with my fork
This commit is contained in:
parent
e7f01b5ba0
commit
8098b42e3d
8 changed files with 109 additions and 0 deletions
|
@ -77,3 +77,13 @@ cache.cything.io {
|
|||
import common
|
||||
reverse_proxy localhost:8090
|
||||
}
|
||||
|
||||
s3.cy7.sh {
|
||||
import common
|
||||
reverse_proxy localhost:3900
|
||||
}
|
||||
|
||||
admin.s3.cy7.sh {
|
||||
import common
|
||||
reverse_proxy localhost:3903
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
./element.nix
|
||||
./attic.nix
|
||||
./forgejo.nix
|
||||
./garage.nix
|
||||
];
|
||||
|
||||
sops.age.keyFile = "/root/.config/sops/age/keys.txt";
|
||||
|
@ -65,6 +66,10 @@
|
|||
"attic/env" = {
|
||||
sopsFile = ../../secrets/services/attic.yaml;
|
||||
};
|
||||
|
||||
"garage/env" = {
|
||||
sopsFile = ../../secrets/services/garage.yaml;
|
||||
};
|
||||
};
|
||||
|
||||
boot.loader.grub.enable = true;
|
||||
|
|
18
hosts/chunk/garage.nix
Normal file
18
hosts/chunk/garage.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{config, pkgs, ...}: {
|
||||
services.garage = {
|
||||
enable = true;
|
||||
package = pkgs.garage;
|
||||
settings = {
|
||||
data_dir = "/mnt/garage";
|
||||
s3_api = {
|
||||
s3_region = "earth";
|
||||
api_bind_addr = "[::]:3900";
|
||||
};
|
||||
admin.api_bind_addr = "[::]:3903";
|
||||
rpc_bind_addr = "[::]:3901";
|
||||
replication_factor = 1;
|
||||
db_engine = "lmdb";
|
||||
};
|
||||
environmentFile = config.sops.secrets."garage/env".path;
|
||||
};
|
||||
}
|
|
@ -38,5 +38,23 @@
|
|||
ExecStop = "${lib.getExe' pkgs.fuse "fusermount"} -u /mnt/attic";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.garage-mount = {
|
||||
enable = true;
|
||||
description = "Mount the garage data remote";
|
||||
requires = [ "network-online.target" ];
|
||||
after = [ "network-online.target" ];
|
||||
requiredBy = [ "garage.service" ];
|
||||
before = [ "garage.service" ];
|
||||
serviceConfig = {
|
||||
Type = "notify";
|
||||
ExecStartPre = "/usr/bin/env mkdir -p /mnt/garage";
|
||||
ExecStart = "${lib.getExe pkgs.rclone} mount --config ${
|
||||
config.sops.secrets."rclone/config".path
|
||||
} --cache-dir /var/cache/rclone --transfers=32 --checkers=32 --vfs-cache-mode writes --vfs-cache-max-size 5G --allow-other rsyncnet:garage /mnt/garage ";
|
||||
ExecStop = "${lib.getExe' pkgs.fuse "fusermount"} -u /mnt/garage";
|
||||
};
|
||||
};
|
||||
|
||||
programs.fuse.userAllowOther = true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue