Fix SMB service

This commit is contained in:
♥ Minnie ♥ 2024-07-16 21:27:20 +08:00
parent 98891a9b15
commit 1fa3e16a8c
Signed by: jasmine
GPG key ID: 8563E358D4E8040E
4 changed files with 15 additions and 11 deletions

View file

@ -1,14 +1,18 @@
{ config, ... }:
{ pkgs, config, ... }:
{
age.secrets.smb-secrets = {
rekeyFile = ./smb-secrets.age;
};
# For mount.cifs, required unless domain name resolution is not needed.
environment.systemPackages = [ pkgs.cifs-utils ];
fileSystems."/home/sajenim/.backup" = {
device = "//192.168.1.102/sajenim";
device = "//192.168.20.4/sajenim";
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,user,users";
in ["${automount_opts},credentials=/etc/nixos/smb-secrets,uid=1000,gid=100"];

View file

@ -1,7 +1,7 @@
age-encryption.org/v1
-> piv-p256 hdSnGw AuXEhgAyxDSAP0HbRE1g0HOaEp9x76AD+681RMOReayb
0fpWaqClsG3wrak0hnU+nB6Dpmdv11CgCl81P5CuwcQ
-> q]sfNw0}-grease {sq
V6m76C8Jvng8SPHoPvyocYo
--- SaJq9U29eLJm6aM9OfiMlINa9rhZ1wy0ZtYU/U1D6BM
y Yºœ_;2&C5> ëjFÄjl^iàè¶pâ=Âh @(.<2E>0¼A†]®Zd¸,ë!Im¯6âå™à“˾=ãÈa f
-> piv-p256 hdSnGw A6SOTJ6Ak8MPRXl4DdNVX/RGn4DztXFsvLRTEL5lzpta
/hIBzwMLsahaAJMLMKt616Kj8xtNlH/CXc0O+Z++7fA
-> #$R.$IT-grease 8.YJD9ko W_{@`a? b ]CR=z$I
IZxSo1rx5e9HQFKq6fkswSjLkE2jpiCOVNAh9HqKa4WXc8GIgEOFAV8ULnIeP2I
--- V8lROz32xt5D85UxUSkh3FMAm25cGIuA+Un0TTL6v90
YŔ‰ Ś^”¶{¤t<C2A4>IŇvmqŤ4ĽĎnÖ˘ĐĐt§9U`Ż#·Ć§<C486>±wµ8Ňd<C587>öîßđ§€[ĐzŔľ¸a2Ă9P5¤Ó¶`Ei”,5·ĂbŰPNŢö“ѡY<CB87>ŐÜ'¦<>÷

View file

@ -31,6 +31,7 @@
networkmanager.enable = true;
firewall = {
enable = true;
allowPing = true;
allowedTCPPorts = [
53 # adguardhome (DNS)
80 # traefik (HTTP)

View file

@ -13,7 +13,7 @@
#use sendfile = yes
#max protocol = smb2
# note: localhost is the ipv6 localhost ::1
hosts allow = 192.168.1.101 192.168.1.108 127.0.0.1 localhost
hosts allow = 192.168.20.5 127.0.0.1 localhost
hosts deny = 0.0.0.0/0
guest account = nobody
map to guest = bad user
@ -47,6 +47,5 @@
openFirewall = true;
};
networking.firewall.enable = true;
networking.firewall.allowPing = true;
environment.persistence."/persist".directories = [ "/var/lib/samba" ];
}