22 lines
492 B
Nix
22 lines
492 B
Nix
{
|
|
pkgs,
|
|
config,
|
|
...
|
|
}: let
|
|
secrets = config.services.secrets.secrets;
|
|
in {
|
|
systemd.services.storage-mount = {
|
|
wantedBy = ["multi-user.target"];
|
|
after = ["network.target" "auto-secrets.service"];
|
|
partOf = ["auto-secrets.service"];
|
|
|
|
path = with pkgs; [bash rclone mount umount];
|
|
script = ''
|
|
set -e
|
|
umount /storage -fl || true
|
|
sleep 2
|
|
rclone --config ${secrets.rclone_config.path} mount StorageBox: /storage --allow-non-empty
|
|
'';
|
|
};
|
|
}
|