Update mount config

This commit is contained in:
Filippo Berto 2023-08-08 14:31:53 +02:00
parent 5d4eb85d53
commit c574b8d106
No known key found for this signature in database
GPG key ID: FE98AE5EC52B1056

View file

@ -42,18 +42,26 @@
''; '';
}; };
systemd.user.services.garage-home-s3 = { systemd.user.services.garage-home-s3-bertof =
let
path = "/home/bertof/s3/bertof";
in
{
Unit = { Unit = {
After = [ "network.target" "network-online.target" "local-fs.target" ]; After = [ "network.target" "network-online.target" "local-fs.target" ];
AssertPathIsDirectory = "/home/bertof/s3"; # AssertPathIsDirectory = path;
AssertPathIsReadWrite = "/home/bertof/s3"; # AssertPathIsReadWrite = path;
Description = "Mount S3 bucket in bertof's home"; Description = "Mount S3 bucket in bertof's home";
StartLimitBurst = 5; StartLimitBurst = 5;
StartLimitInterval = 200; StartLimitInterval = 200;
Wants = [ "network.target" "network-online.target" ]; Wants = [ "network.target" "network-online.target" ];
}; };
Service = { Service = {
ExecStart = "${pkgs.s3fs}/bin/s3fs -f -d bertof /home/bertof/s3 -o passwd_file=${nixosConfig.age.secrets.garage_bertof_odin_key.path},use_path_request_style,url=http://localhost:3900"; ExecStart = pkgs.writeShellScript "garage-home-s3-bertof" ''
set -e
${pkgs.coreutils}/bin/mkdir -p '${path}'
${pkgs.s3fs}/bin/s3fs -f -d bertof ${path} -o passwd_file=${nixosConfig.age.secrets.garage_bertof_odin_key.path},use_path_request_style,url=http://localhost:3900
'';
Restart = "always"; Restart = "always";
RestartSec = 30; RestartSec = 30;
Type = "exec"; Type = "exec";