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

Binary file not shown.

View file

@ -15,4 +15,5 @@ in
"wg-ren.priv".publicKeys = macbook++master++ren;
"ren.priv".publicKeys = master ++ ren;
"mullvad".publicKeys = master ++ ren ++ macbook;
"smbshare".publicKeys = master ++ macbook ++ ren ++ selene;
}

13
keys/smbshare Normal file
View file

@ -0,0 +1,13 @@
age-encryption.org/v1
-> ssh-ed25519 CJLJQg iKSC2yZMoiMcQ/uphfV9KSPaMZDujTJ8RF9iNj2cwl0
naZwmb0c73GsZmLnoOLFjPFLahIvJ9uNPm9eKn9wuk4
-> ssh-ed25519 M7OTMg OzqVt888r84ORO8K+sGPUktLe0Hlex5mH6tveRE+Nmo
hB69RP7R9mAPOtnYF27c+vs3lJfmo2HLygpUPCdg4o4
-> ssh-ed25519 uNZY8Q rSg+s2zyvi+pc8f+2+jpoV2d4QnSK6bc5FlUJYUvKn0
vQ4DrQjuU+6SMF74qYIljm47DiwgFRTe0jOHgRhZhP8
-> ssh-ed25519 gSqcWw tb4ZOplFZCXerynrFIRjTJ6s/itwRmsVeJSxDpf7NmE
n8dmh88E/gSr8TGUxNGEYz5JoAczN/PeCXEEAPzATh0
-> ssh-ed25519 lFtjmQ hILkY+TxULWVfFsm7iF+W5lARxBl3MdWEerO6JHYIhQ
Q7xEwwZ3RM73a0lLs63TKKfHKrK7+YWKYpW27brwlOQ
--- fjttmh2HNROYUIMYVu1Yxft9diCU4tx+DIFYBeEUelc
ൊ0÷ÌšŸH®³÷•XgÌlgIÑ­ØÛn—Ü^]¾„Gx°Bµp1‰K*‚Ê( ê<>mCŽu^V¦_h"KÄìüi)üœÄ÷ü}7ÈÃ<C383>ÇÜ]¿Ï©Ð‰ñõjóÂàRÝ xÝ¿=÷ õ´ÉŒìqÔîžÞ‚¥×³

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" = {

View file

@ -20,24 +20,27 @@
];
};
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}
'';
environment.systemPackages = [
pkgs.rclone
pkgs.samba
pkgs.cifs-utils
];
age.secrets.smbsecret = {
file = ../../keys/smbshare;
owner = "selene";
};
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 = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s";
in
[ "${automount_opts},credentials=${config.age.secrets.smbsecret.path}" ];
};
}