mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 09:07:21 +01:00
feat: open ports for nfs shares [winters]
This commit is contained in:
parent
a3fa94958f
commit
33cfbba58b
2 changed files with 54 additions and 50 deletions
|
|
@ -6584,59 +6584,61 @@ Also, the system state version is set here. No need to touch it.
|
||||||
**** nfs/samba (smb)
|
**** nfs/samba (smb)
|
||||||
|
|
||||||
#+begin_src nix :tangle profiles/server/common/nfs.nix
|
#+begin_src nix :tangle profiles/server/common/nfs.nix
|
||||||
{ pkgs, lib, config, ... }:
|
{ pkgs, lib, config, ... }:
|
||||||
{
|
{
|
||||||
services = {
|
services = {
|
||||||
# Network shares
|
# Network shares
|
||||||
# add a user with sudo smbpasswd -a <user>
|
# add a user with sudo smbpasswd -a <user>
|
||||||
samba = {
|
samba = {
|
||||||
package = pkgs.samba4Full;
|
package = pkgs.samba4Full;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
workgroup = WORKGROUP
|
workgroup = WORKGROUP
|
||||||
server role = standalone server
|
server role = standalone server
|
||||||
dns proxy = no
|
dns proxy = no
|
||||||
|
|
||||||
pam password change = yes
|
pam password change = yes
|
||||||
map to guest = bad user
|
map to guest = bad user
|
||||||
create mask = 0664
|
create mask = 0664
|
||||||
force create mode = 0664
|
force create mode = 0664
|
||||||
directory mask = 0775
|
directory mask = 0775
|
||||||
force directory mode = 0775
|
force directory mode = 0775
|
||||||
follow symlinks = yes
|
follow symlinks = yes
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# ^^ `samba4Full` is compiled with avahi, ldap, AD etc support compared to the default package, `samba`
|
# ^^ `samba4Full` is compiled with avahi, ldap, AD etc support compared to the default package, `samba`
|
||||||
# Required for samba to register mDNS records for auto discovery
|
# Required for samba to register mDNS records for auto discovery
|
||||||
# See https://github.com/NixOS/nixpkgs/blob/592047fc9e4f7b74a4dc85d1b9f5243dfe4899e3/pkgs/top-level/all-packages.nix#L27268
|
# See https://github.com/NixOS/nixpkgs/blob/592047fc9e4f7b74a4dc85d1b9f5243dfe4899e3/pkgs/top-level/all-packages.nix#L27268
|
||||||
enable = true;
|
enable = true;
|
||||||
# openFirewall = true;
|
openFirewall = true;
|
||||||
shares.Eternor = {
|
shares.Eternor = {
|
||||||
browseable = "yes";
|
browseable = "yes";
|
||||||
"read only" = "no";
|
"read only" = "no";
|
||||||
"guest ok" = "no";
|
"guest ok" = "no";
|
||||||
path = "/Vault/Eternor";
|
path = "/Vault/Eternor";
|
||||||
writable = "true";
|
writable = "true";
|
||||||
comment = "Eternor";
|
comment = "Eternor";
|
||||||
"valid users" = "@Swarsel";
|
"valid users" = "@Swarsel";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
avahi = {
|
||||||
|
publish.enable = true;
|
||||||
|
publish.userServices = true;
|
||||||
|
# ^^ Needed to allow samba to automatically register mDNS records without the need for an `extraServiceFile`
|
||||||
|
nssmdns4 = true;
|
||||||
|
# ^^ Not one hundred percent sure if this is needed- if it aint broke, don't fix it
|
||||||
|
enable = true;
|
||||||
|
openFirewall = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
samba-wsdd = {
|
||||||
|
# This enables autodiscovery on windows since SMB1 (and thus netbios) support was discontinued
|
||||||
|
enable = true;
|
||||||
|
openFirewall = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
avahi = {
|
|
||||||
publish.enable = true;
|
|
||||||
publish.userServices = true;
|
|
||||||
# ^^ Needed to allow samba to automatically register mDNS records without the need for an `extraServiceFile`
|
|
||||||
nssmdns4 = true;
|
|
||||||
# ^^ Not one hundred percent sure if this is needed- if it aint broke, don't fix it
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
samba-wsdd = {
|
|
||||||
# This enables autodiscovery on windows since SMB1 (and thus netbios) support was discontinued
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
**** NGINX
|
**** NGINX
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
# Required for samba to register mDNS records for auto discovery
|
# Required for samba to register mDNS records for auto discovery
|
||||||
# See https://github.com/NixOS/nixpkgs/blob/592047fc9e4f7b74a4dc85d1b9f5243dfe4899e3/pkgs/top-level/all-packages.nix#L27268
|
# See https://github.com/NixOS/nixpkgs/blob/592047fc9e4f7b74a4dc85d1b9f5243dfe4899e3/pkgs/top-level/all-packages.nix#L27268
|
||||||
enable = true;
|
enable = true;
|
||||||
# openFirewall = true;
|
openFirewall = true;
|
||||||
shares.Eternor = {
|
shares.Eternor = {
|
||||||
browseable = "yes";
|
browseable = "yes";
|
||||||
"read only" = "no";
|
"read only" = "no";
|
||||||
|
|
@ -43,11 +43,13 @@
|
||||||
nssmdns4 = true;
|
nssmdns4 = true;
|
||||||
# ^^ Not one hundred percent sure if this is needed- if it aint broke, don't fix it
|
# ^^ Not one hundred percent sure if this is needed- if it aint broke, don't fix it
|
||||||
enable = true;
|
enable = true;
|
||||||
|
openFirewall = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
samba-wsdd = {
|
samba-wsdd = {
|
||||||
# This enables autodiscovery on windows since SMB1 (and thus netbios) support was discontinued
|
# This enables autodiscovery on windows since SMB1 (and thus netbios) support was discontinued
|
||||||
enable = true;
|
enable = true;
|
||||||
|
openFirewall = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue