Skip to content

Commit

Permalink
feat(media): simplify smb mounts
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Dec 13, 2024
1 parent 5b0689b commit 515a217
Showing 1 changed file with 18 additions and 27 deletions.
45 changes: 18 additions & 27 deletions hosts/media/hardware-configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,22 @@
...
}:

let
fsOptions = [
# Prevent hanging on network split
"x-systemd.automount"
"noauto"
"x-systemd.idle-timeout=60"
"x-systemd.device-timeout=5s"
"x-systemd.mount-timeout=5s"
# Mount as user
"uid=1000" # user
"gid=1" # wheel
# Credentials need to be stored in a file
"credentials=${config.sops.secrets.smb-secrets.path}"
"rw"
];
in
{
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
Expand Down Expand Up @@ -38,38 +54,13 @@
fileSystems."/mnt/share/backups" = {
device = "//nas/backups";
fsType = "cifs";
options = [
# Prevent hanging on network split
"x-systemd.automount"
"noauto"
"x-systemd.idle-timeout=60"
"x-systemd.device-timeout=5s"
"x-systemd.mount-timeout=5s"
# Mount as user
"uid=1000" # user
"gid=1" # wheel
# Credentials need to be stored in a file
"credentials=${config.sops.secrets.smb-secrets.path}"
"rw"
];
options = fsOptions;
};

fileSystems."/mnt/share/autopirate" = {
device = "//nas/autopirate";
fsType = "cifs";
options = [
# Prevent hanging on network split
"x-systemd.automount"
"noauto"
"x-systemd.idle-timeout=60"
"x-systemd.device-timeout=5s"
"x-systemd.mount-timeout=5s"
# Mount as user
"uid=1000" # user
"gid=1" # wheel
# Credentials need to be stored in a file
"credentials=${config.sops.secrets.smb-secrets.path}"
"rw"
options = fsOptions ++ [
"nobrl" # Disable byte-range locks (required for Servarr)
];
};
Expand Down

0 comments on commit 515a217

Please sign in to comment.