2016-10-19 12:31:13 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
2016-10-20 20:54:38 +02:00
|
|
|
with import <stockholm/lib>;
|
2016-10-19 12:31:13 +02:00
|
|
|
let
|
|
|
|
hostname = config.krebs.build.host.name;
|
|
|
|
in {
|
|
|
|
users.users.smbguest = {
|
|
|
|
name = "smbguest";
|
2021-06-05 20:06:00 +02:00
|
|
|
uid = config.ids.uids.smbguest; # effectively systemUser
|
2016-10-19 12:31:13 +02:00
|
|
|
description = "smb guest user";
|
|
|
|
home = "/var/empty";
|
2021-12-04 21:02:32 +01:00
|
|
|
group = "share";
|
2016-10-19 12:31:13 +02:00
|
|
|
};
|
2021-12-04 21:02:32 +01:00
|
|
|
users.groups.share = {};
|
2016-10-19 12:31:13 +02:00
|
|
|
services.samba = {
|
|
|
|
enable = true;
|
|
|
|
shares = {
|
|
|
|
media = {
|
|
|
|
path = "/media/";
|
|
|
|
"read only" = "no";
|
|
|
|
browseable = "yes";
|
|
|
|
"guest ok" = "yes";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
extraConfig = ''
|
|
|
|
guest account = smbguest
|
|
|
|
map to guest = bad user
|
|
|
|
# disable printing
|
|
|
|
load printers = no
|
|
|
|
printing = bsd
|
|
|
|
printcap name = /dev/null
|
|
|
|
disable spoolss = yes
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|