add samba

This commit is contained in:
Kopatz
2025-10-23 10:59:01 +02:00
parent 4cc83041c6
commit 1f219cbb81
3 changed files with 41 additions and 28 deletions

View File

@@ -23,7 +23,7 @@
}; };
}; };
html.enable = true; html.enable = true;
dartls.enable = true; dartls.enable = true; # handled by flutter-tools
ts_ls.enable = true; ts_ls.enable = true;
pylsp.enable = true; pylsp.enable = true;
lua_ls.enable = true; lua_ls.enable = true;

View File

@@ -1,36 +1,42 @@
{ {
#services.samba-wsdd.enable = true; # make shares visible for windows 10 clients services.samba-wsdd = {
#networking.firewall.allowedTCPPorts = [ enable = true;
#5357 # wsdd openFirewall = true;
#]; };
#networking.firewall.allowedUDPPorts = [
#3702 # wsdd users.users.franz = {
#]; isNormalUser = true;
services.samba.openFirewall = true; home = "/home/franz";
hashedPassword = "$y$j9T$opts2crrOHbRzHsFzOh/S1$LU3zmC4tKOw43THlOSw6qDXPse.l1ZvcxolN3EP7/ED";
};
# add user to samba with smbpasswd -a
services.samba = { services.samba = {
enable = true; enable = true;
securityType = "user"; openFirewall = true;
invalidUsers = [ invalidUsers = [
"root" "root"
]; ];
extraConfig = '' settings = {
disable netbios = yes global = {
smb ports = 445 "workgroup" = "WORKGROUP";
workgroup = WORKGROUP "server string" = "smbnix";
server string = smbnix "netbios name" = "smbnix";
security = user "security" = "user";
#use sendfile = yes #"use sendfile" = "yes";
#max protocol = smb2 #"max protocol" = "smb2";
# note: localhost is the ipv6 localhost ::1 # note: localhost is the ipv6 localhost ::1
hosts allow = 192.168.0. 192.168.174.1 127.0.0.1 localhost "hosts allow" = "192.168.0. 127.0.0.1 localhost";
hosts deny = 0.0.0.0/0 "hosts deny" = "0.0.0.0/0";
guest account = nobody "guest account" = "nobody";
map to guest = bad user "map to guest" = "bad user";
''; };
shares = { "franz" = {
homes = { "path" = "/hdd/shares/franz";
browseable = "no"; "valid users" = "franz";
writable = "yes"; "public" = "no";
"writable" = "yes";
"printable" = "no";
}; };
}; };
}; };

View File

@@ -10,6 +10,7 @@
../../modules/misc/motd.nix ../../modules/misc/motd.nix
../../modules/misc/kernel.nix ../../modules/misc/kernel.nix
../../modules/services/duckdns.nix ../../modules/services/duckdns.nix
../../modules/services/samba.nix
../../modules/services/ddclient-cloudflare.nix ../../modules/services/ddclient-cloudflare.nix
./disk-config.nix ./disk-config.nix
./mail.nix ./mail.nix
@@ -152,6 +153,12 @@
options = [ "defaults" "nofail" "noatime" ]; options = [ "defaults" "nofail" "noatime" ];
}; };
fileSystems."/hdd" = {
device = "/dev/disk/by-uuid/99954059-3801-4abb-a536-0e7802a3e6b4";
fsType = "ext4";
options = [ "defaults" "nofail" "noatime" ];
};
# Configure console keymap # Configure console keymap
console.keyMap = "us"; console.keyMap = "us";