2025.04.30-20:50
This commit is contained in:
78
nixos_24.11_wlin001/system/smb-mount-fsrv.nix
Normal file
78
nixos_24.11_wlin001/system/smb-mount-fsrv.nix
Normal file
@ -0,0 +1,78 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = [ pkgs.cifs-utils ];
|
||||
|
||||
fileSystems."/mnt/fileserver01/Appz" = {
|
||||
device = "//192.168.10.52/appz/";
|
||||
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,user,users";
|
||||
in ["${automount_opts},credentials=/etc/nixos/secrets/samba-secrets,uid=1000,gid=100"];
|
||||
};
|
||||
|
||||
fileSystems."/mnt/fileserver01/Backup" = {
|
||||
device = "//192.168.10.52/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,user,users";
|
||||
in ["${automount_opts},credentials=/etc/nixos/secrets/samba-secrets,uid=1000,gid=100"];
|
||||
};
|
||||
|
||||
fileSystems."/mnt/fileserver01/Dateien" = {
|
||||
device = "//192.168.10.52/dateien/";
|
||||
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,user,users";
|
||||
in ["${automount_opts},credentials=/etc/nixos/secrets/samba-secrets,uid=1000,gid=100"];
|
||||
};
|
||||
|
||||
fileSystems."/mnt/fileserver01/Downloads" = {
|
||||
device = "//192.168.10.52/downloads/";
|
||||
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,user,users";
|
||||
in ["${automount_opts},credentials=/etc/nixos/secrets/samba-secrets,uid=1000,gid=100"];
|
||||
};
|
||||
|
||||
fileSystems."/mnt/fileserver01/ISOs" = {
|
||||
device = "//192.168.10.52/isos/";
|
||||
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,user,users";
|
||||
in ["${automount_opts},credentials=/etc/nixos/secrets/samba-secrets,uid=1000,gid=100"];
|
||||
};
|
||||
|
||||
fileSystems."/mnt/fileserver01/Multimedia" = {
|
||||
device = "//192.168.10.52/multimedia/";
|
||||
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,user,users";
|
||||
in ["${automount_opts},credentials=/etc/nixos/secrets/samba-secrets,uid=1000,gid=100"];
|
||||
};
|
||||
|
||||
fileSystems."/mnt/fileserver01/Public" = {
|
||||
device = "//192.168.10.52/public/";
|
||||
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,user,users";
|
||||
in ["${automount_opts},credentials=/etc/nixos/secrets/samba-secrets,uid=1000,gid=100"];
|
||||
};
|
||||
|
||||
fileSystems."/mnt/fileserver01/Share" = {
|
||||
device = "//192.168.10.52/share/";
|
||||
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,user,users";
|
||||
in ["${automount_opts},credentials=/etc/nixos/secrets/samba-secrets,uid=1000,gid=100"];
|
||||
};
|
||||
|
||||
}
|
Reference in New Issue
Block a user