1
1
Fork 0

backyard: add home samba share

This commit is contained in:
Tim Van Baak 2024-04-16 02:28:04 +00:00
parent 5a2c7aa559
commit 263d8ac788
2 changed files with 64 additions and 0 deletions

View File

@ -4,6 +4,7 @@
imports = [
./hardware-configuration.nix
./jellyfin.nix
./samba.nix
];
# Use the systemd-boot EFI boot loader.

View File

@ -0,0 +1,63 @@
{ pkgs, lib, ... }:
{
# This is mostly to get smbpasswd
environment.systemPackages = [ pkgs.samba ];
services.samba-wsdd = {
enable = true;
openFirewall = true;
};
services.samba = {
enable = true;
openFirewall = true;
securityType = "user";
extraConfig = ''
workgroup = beatific
server string = backyard smb server
netbios name = backyard
deadtime = 300
local master = yes
domain master = yes
preferred master = yes
guest account = nobody
map to guest = bad user
case sensitive = yes
veto files = /^.DS_Store$/^.Trash-1000$/
load printers = no
printcap name = /dev/null
printing = bsd
log file = /var/log/samba/client-%m.log
log level = 2
max log size = 64
hide dot files = no
hosts allow = 10.22.20., 192.168.1.
map archive = no
unix extensions = yes
ntlm auth = yes
'';
shares = let
homeShare = user: {
path = "/home/${user}";
comment = "${user}'s home folder";
browseable = "yes";
"read only" = "no";
"guest okay" = "no";
"create mask" = "0640";
"force create mode" = "0640";
"directory mask" = "0750";
"force directory mode" = "0750";
"valid users" = "${user}";
};
in {
tvb = homeShare "tvb";
};
};
}