switching all smb to nfs

This commit is contained in:
Matt Nish-Lapidus 2025-04-05 13:53:10 -04:00
parent 0420380240
commit a1434cee4e
2 changed files with 56 additions and 43 deletions

View file

@ -125,36 +125,48 @@
openFirewall = true; openFirewall = true;
nssmdns4 = true; nssmdns4 = true;
}; };
services.samba = {
enable = true; services.rpcbind.enable = true;
package = pkgs.sambaFull;
openFirewall = true; services.nfs = {
settings = { server = {
global = { enable = true;
"workgroup" = "WORKGROUP"; exports = ''
"server string" = "media-server"; /mnt/shares/import *(rw,fsid=0,no_subtree_check)
"netbios name" = "media-server"; '';
"security" = "user";
# "hosts allow" = "192.168.50. 127.0.0.1 localhost";
# "hosts deny" = "0.0.0.0/0";
"guest account" = "nobody";
"map to guest" = "bad user";
};
"import" = {
"path" = "/mnt/shares/import";
"browseable" = "yes";
"read only" = "no";
"guest ok" = "no";
"create mask" = "0644";
"directory mask" = "0755";
"force user" = "media";
};
}; };
}; };
services.samba-wsdd = {
enable = true; # services.samba = {
openFirewall = true; # enable = true;
}; # package = pkgs.sambaFull;
# openFirewall = true;
# settings = {
# global = {
# "workgroup" = "WORKGROUP";
# "server string" = "media-server";
# "netbios name" = "media-server";
# "security" = "user";
# # "hosts allow" = "192.168.50. 127.0.0.1 localhost";
# # "hosts deny" = "0.0.0.0/0";
# "guest account" = "nobody";
# "map to guest" = "bad user";
# };
# "import" = {
# "path" = "/mnt/shares/import";
# "browseable" = "yes";
# "read only" = "no";
# "guest ok" = "no";
# "create mask" = "0644";
# "directory mask" = "0755";
# "force user" = "media";
# };
# };
# };
# services.samba-wsdd = {
# enable = true;
# openFirewall = true;
# };
programs.nix-ld.enable = true; programs.nix-ld.enable = true;

View file

@ -1,35 +1,36 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
services.rpcbind.enable = true; # needed for NFS
fileSystems = fileSystems =
let let
automount-opts = "x-systemd.automount,noauto,users,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s,noperm,uid=1000"; opts = [ "nfsvers=4.1" "noatime" "noauto" ];
filez-opts = automount-opts + ",credentials=/etc/nixos/filez-secrets";
# media-server-opts = automount-opts + ",credentials=/etc/nixos/media-server-secrets";
in { in {
"/mnt/filez/media" = { "/mnt/filez/media" = {
device = "//Filez/Media"; device = "filez:/volume1/Media";
fsType = "smb3"; fsType = "nfs";
options = [ "${filez-opts}" ]; options = opts;
}; };
"/mnt/filez/music-production" = { "/mnt/filez/music-production" = {
device = "//Filez/Music Production"; device = "filez:/volume1/Music Production";
fsType = "smb3"; fsType = "nfs";
options = [ "${filez-opts}" ]; options = opts;
}; };
"/mnt/filez/storage" = { "/mnt/filez/storage" = {
device = "//Filez/Storage"; device = "filez:/volume1/Storage";
fsType = "smb3"; fsType = "nfs";
options = [ "${filez-opts}" ]; options = opts;
}; };
"/mnt/filez/photos" = { "/mnt/filez/photos" = {
device = "//Filez/Photo Storage"; device = "filez:/volume1/Photo Storage";
fsType = "smb3"; fsType = "nfs";
options = [ "${filez-opts}" ]; options = opts;
}; };
}; };
} }