diff --git a/devices/nas.nix b/devices/nas.nix index 21dac9c..2b9e945 100644 --- a/devices/nas.nix +++ b/devices/nas.nix @@ -26,10 +26,10 @@ # fsType = "ext4"; # }; - #fileSystems."/srv/dev-disk-by-uuid-18333f38-626c-4c22-af29-314a87282809" = - # { device = "/dev/mapper/base--storage-ShatteredMINT"; - # fsType = "ext4"; - # }; + fileSystems."/srv/shatteredmint" = + { device = "/dev/mapper/base--storage-ShatteredMINT"; + fsType = "ext4"; + }; #fileSystems."/srv/dev-disk-by-uuid-98570615-8eda-4a45-8a20-3c58b50e3d79" = # { device = "/dev/mapper/base--storage-NAS"; diff --git a/flake.nix b/flake.nix index e9f59ff..34831b0 100644 --- a/flake.nix +++ b/flake.nix @@ -67,6 +67,7 @@ ./configuration.nix ./users/shatteredmint.nix + ./software/samba.nix ]; }; }; diff --git a/network-shares.nix b/network-shares.nix index 111bd42..6335bf5 100644 --- a/network-shares.nix +++ b/network-shares.nix @@ -1,17 +1,28 @@ { config, lib, pkgs, ... }: { - # mount network shares - fileSystems."/mnt/nas/private" = { - device = "dashboard.omv:/ShatteredMINT"; - fsType = "nfs"; - options = [ "x-systemd.automount" "noauto" ]; + environment.systemPackages = [ pkgs.cifs-utils ]; + fileSystems."/mnt/share" = { + device = "//192.168.178.108/srv/private-shatteredmint"; + 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=/etc/nixos/smb-secrets"]; }; - fileSystems."/mnt/nas/shared" = { - device = "dashboard.omv:/default-nas"; - fsType = "nfs"; - options = [ "x-systemd.automount" "noauto" ]; - }; + # # mount network shares + # fileSystems."/mnt/nas/private" = { + # device = "dashboard.omv:/ShatteredMINT"; + # fsType = "nfs"; + # options = [ "x-systemd.automount" "noauto" ]; + # + # }; + # fileSystems."/mnt/nas/shared" = { + # device = "dashboard.omv:/default-nas"; + # fsType = "nfs"; + # options = [ "x-systemd.automount" "noauto" ]; + # + # }; } diff --git a/software/samba.nix b/software/samba.nix new file mode 100644 index 0000000..4b64dd4 --- /dev/null +++ b/software/samba.nix @@ -0,0 +1,29 @@ +{config, pkgs, ...} : { + services = { + samba = { + enable = true; + package = pkgs.samba4Full; + openFirewall = true; + + settings = { + global = { + "server smb encrypt" = "required"; + "server min protocol" = "SMB3_00"; + "workgroup" = "WORKGROUP"; + "security" = "user"; + }; + + "private-shatteredmint" = { + "path" = "/srv/shatteredmint"; + "writable" = "yes"; + "comment" = "private share for shatteredmint"; + "browseable" = "yes"; + }; + }; + }; + samba-wsdd = { + enable = true; + openFirewall = true; + }; + }; +}