35 lines
880 B
Nix
35 lines
880 B
Nix
{ pkgs, config, ... }:
|
|
{
|
|
environment.systemPackages = [ pkgs.rclone ];
|
|
environment.etc."rclone-mnt.conf".text = ''
|
|
[myremote]
|
|
type = sftp
|
|
host = u504615.your-storagebox.de
|
|
user = u504615
|
|
key_file = ${config.age.secrets.hetzner-key.path}
|
|
'';
|
|
|
|
fileSystems."/mnt/sbox" = {
|
|
device = "myremote:/";
|
|
fsType = "rclone";
|
|
options = [
|
|
"nodev"
|
|
"nofail"
|
|
"allow_other"
|
|
"args2env"
|
|
"config=/etc/rclone-mnt.conf"
|
|
];
|
|
};
|
|
|
|
fileSystems."/mnt/sbox2" = {
|
|
device = "//u504615.your-storagebox.de/backup";
|
|
fsType = "cifs";
|
|
options =
|
|
let
|
|
# this line prevents hanging on network split
|
|
automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s";
|
|
|
|
in
|
|
[ "${automount_opts},credentials=/etc/nixos/smb-secrets" ];
|
|
};
|
|
}
|