switching all smb to nfs
This commit is contained in:
parent
0420380240
commit
a1434cee4e
2 changed files with 56 additions and 43 deletions
|
@ -125,36 +125,48 @@
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
nssmdns4 = true;
|
nssmdns4 = true;
|
||||||
};
|
};
|
||||||
services.samba = {
|
|
||||||
|
services.rpcbind.enable = true;
|
||||||
|
|
||||||
|
services.nfs = {
|
||||||
|
server = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.sambaFull;
|
exports = ''
|
||||||
openFirewall = true;
|
/mnt/shares/import *(rw,fsid=0,no_subtree_check)
|
||||||
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 = {
|
# services.samba = {
|
||||||
enable = true;
|
# enable = true;
|
||||||
openFirewall = 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;
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue