Add smb mount instead

This commit is contained in:
Maxiem Geldhof 2025-11-03 20:01:39 +01:00
parent dac753ceab
commit 8c9c8310b3
5 changed files with 49 additions and 26 deletions

View file

@ -3,6 +3,7 @@
environment.systemPackages = [
pkgs.rclone
pkgs.samba
pkgs.cifs-utils
];
environment.etc."rclone-mnt.conf".text = ''
[myremote]
@ -12,16 +13,21 @@
key_file = ${config.age.secrets.hetzner-key.path}
'';
age.secrets.smbsecret = {
file = ../../keys/smbshare;
owner = "ren";
};
fileSystems."/mnt/sbox" = {
device = "myremote:/";
fsType = "rclone";
options = [
"nodev"
"nofail"
"allow_other"
"args2env"
"config=/etc/rclone-mnt.conf"
];
device = "//u504615.your-storagebox.de/backup";
fsType = "cifs";
options =
let
# this line prevents hanging on network split
automount_opts = "rw,x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s,dir_mode=0777";
in
[ "${automount_opts},credentials=${config.age.secrets.smbsecret.path}" ];
};
fileSystems."/mnt/scratch" = {