Add basic Samba config for the scanner

This allows the scanner to log into samba with its own username and
password.
This commit is contained in:
Eli Ribble 2024-07-31 17:04:56 +00:00
parent b31ab6e7ca
commit 6763a973a0
1 changed files with 46 additions and 0 deletions

View File

@ -58,6 +58,7 @@
# Enable touchpad support (enabled default in most desktopManager).
# services.libinput.enable = true;
users.groups.scanner = {};
users.groups.step = {};
# Define a user account. Don't forget to set a password with passwd.
@ -70,6 +71,12 @@
# tree
# ];
};
users.users.scanner = {
group = "scanner";
isNormalUser = false;
isSystemUser = true;
description = "User for the scanner to log in to samba";
};
users.users.step = {
group = "step";
isNormalUser = false;
@ -173,6 +180,45 @@
# Enable the OpenSSH daemon.
services.openssh.enable = true;
# Set up a samba share for the scanner
services.samba = {
enable = true;
openFirewall = true;
extraConfig = ''
workgroup = WORKGROUP
server string smbnix
netbios name = smbnix
security = user
guest account = nobody
map to guest = bad user
'';
shares = {
public = {
path = "/mnt/shares/public";
browseable = "yes";
"read only" = "no";
"guest ok" = "yes";
"create mask" = "0644";
"directory mask" = "0755";
"force user" = "username";
"force group" = "groupname";
};
private = {
path = "/mnt/shares/private";
browseable = "yes";
"read only" = "no";
"guest ok" = "no";
"create mask" = "0644";
"directory mask" = "0755";
"force user" = "username";
"force group" = "groupname";
};
};
};
services.samba-wsdd = {
enable = true;
openFirewall = true;
};
# Enable Tailscale
services.tailscale.enable = true;