From ecc84e35bd94517f6c07f9db5330b1c8c2d4361d Mon Sep 17 00:00:00 2001 From: Dmitriy Kholkin Date: Fri, 7 Aug 2020 15:57:08 +0400 Subject: [PATCH] fix smb mount --- modules/filesystems.nix | 50 +++++++++++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 9 deletions(-) diff --git a/modules/filesystems.nix b/modules/filesystems.nix index 774354c..4501df2 100644 --- a/modules/filesystems.nix +++ b/modules/filesystems.nix @@ -2,7 +2,11 @@ with rec { inherit (config) device deviceSpecific secrets; }; -with deviceSpecific; { +with deviceSpecific; +# let +# wgEnabled = config.secrets.wireguard.${config.device}.enable; +# in +{ fileSystems = { "/shared/nixos" = lib.mkIf isVM { fsType = "vboxsf"; @@ -23,7 +27,6 @@ with deviceSpecific; { fsType = "ntfs"; device = "/dev/disk/by-partuuid/944f923d-cf08-4752-bf3f-8aa8e0190260"; options = [ - # "ro" # "noatime" "nofail" "uid=${toString config.users.users.alukard.uid}" @@ -34,20 +37,26 @@ with deviceSpecific; { fsType = "cifs"; device = "//192.168.0.100/data"; options = [ - # "ro" "user=${secrets.linux-samba.user}" "password=${secrets.linux-samba.password}" - # "nofail" "uid=${toString config.users.users.alukard.uid}" "gid=${toString config.users.groups.users.gid}" + "vers=3.0" + "nofail" + "noauto" + "x-systemd.automount" + "x-systemd.mount-timeout=15" + "_netdev" ]; + # ] ++ lib.optionals wgEnabled [ + # "x-systemd.after=wg-quick-wg0.service" + # ]; }; "/media/files" = if isHost then { # Samba host fsType = "ntfs"; device = "/dev/disk/by-partuuid/8a1d933c-302b-4e62-b9af-a45ecd05777f"; options = [ - # "ro" # "noatime" "nofail" "uid=${toString config.users.users.alukard.uid}" @@ -60,10 +69,18 @@ with deviceSpecific; { options = [ "user=${secrets.linux-samba.user}" "password=${secrets.linux-samba.password}" - # "nofail" "uid=${toString config.users.users.alukard.uid}" "gid=${toString config.users.groups.users.gid}" + "vers=3.0" + "nofail" + "noauto" + "x-systemd.automount" + "x-systemd.mount-timeout=15" + "_netdev" ]; + # ] ++ lib.optionals wgEnabled [ + # "x-systemd.after=wg-quick-wg0.service" + # ]; }; # Samba Windows "/media/windows/files" = lib.mkIf (!isHost) { @@ -72,22 +89,37 @@ with deviceSpecific; { options = [ "user=${secrets.windows-samba.user}" "password=${secrets.windows-samba.password}" - # "nofail" "uid=${toString config.users.users.alukard.uid}" "gid=${toString config.users.groups.users.gid}" + "vers=3.0" + "nofail" + "noauto" + "x-systemd.automount" + "x-systemd.mount-timeout=15" + "_netdev" ]; + # ] ++ lib.optionals wgEnabled [ + # "x-systemd.after=wg-quick-wg0.service" + # ]; }; "/media/windows/data" = lib.mkIf (!isHost) { fsType = "cifs"; device = "//192.168.0.100/Data"; options = [ - "ro" "user=${secrets.windows-samba.user}" "password=${secrets.windows-samba.password}" - # "nofail" "uid=${toString config.users.users.alukard.uid}" "gid=${toString config.users.groups.users.gid}" + "vers=3.0" + "nofail" + "noauto" + "x-systemd.automount" + "x-systemd.mount-timeout=15" + "_netdev" ]; + # ] ++ lib.optionals wgEnabled [ + # "x-systemd.after=wg-quick-wg0.service" + # ]; }; }; }