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;
nssmdns4 = true;
};
services.samba = {
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.rpcbind.enable = true;
services.nfs = {
server = {
enable = true;
exports = ''
/mnt/shares/import *(rw,fsid=0,no_subtree_check)
'';
};
};
services.samba-wsdd = {
enable = true;
openFirewall = true;
};
# services.samba = {
# 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;

View file

@ -1,35 +1,36 @@
{ config, lib, pkgs, ... }:
{
services.rpcbind.enable = true; # needed for NFS
fileSystems =
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";
filez-opts = automount-opts + ",credentials=/etc/nixos/filez-secrets";
# media-server-opts = automount-opts + ",credentials=/etc/nixos/media-server-secrets";
opts = [ "nfsvers=4.1" "noatime" "noauto" ];
in {
"/mnt/filez/media" = {
device = "//Filez/Media";
fsType = "smb3";
options = [ "${filez-opts}" ];
device = "filez:/volume1/Media";
fsType = "nfs";
options = opts;
};
"/mnt/filez/music-production" = {
device = "//Filez/Music Production";
fsType = "smb3";
options = [ "${filez-opts}" ];
device = "filez:/volume1/Music Production";
fsType = "nfs";
options = opts;
};
"/mnt/filez/storage" = {
device = "//Filez/Storage";
fsType = "smb3";
options = [ "${filez-opts}" ];
device = "filez:/volume1/Storage";
fsType = "nfs";
options = opts;
};
"/mnt/filez/photos" = {
device = "//Filez/Photo Storage";
fsType = "smb3";
options = [ "${filez-opts}" ];
device = "filez:/volume1/Photo Storage";
fsType = "nfs";
options = opts;
};
};
}