29c5178bdf
list of user accounts that the job needs to run. For instance, the SSH daemon job says: { name = "sshd"; uid = (import ../system/ids.nix).uids.sshd; description = "SSH privilege separation user"; home = "/var/empty"; } The activation script creates the system users/groups and updates them as well. So a change in the Nix expression can be realised in /etc/{group,passwd} by running nixos-rebuild. svn path=/nixos/trunk/; revision=8846
44 lines
642 B
Nix
44 lines
642 B
Nix
{pkgs, samba, glibc, pwdutils}:
|
|
|
|
let
|
|
|
|
user = "smbguest";
|
|
group = "smbguest";
|
|
|
|
in
|
|
|
|
{
|
|
name = "samba";
|
|
|
|
users = [
|
|
{ name = user;
|
|
description = "Samba service user";
|
|
group = group;
|
|
}
|
|
];
|
|
|
|
job = "
|
|
|
|
description \"Samba Service\"
|
|
|
|
start on network-interfaces/started
|
|
stop on network-interfaces/stop
|
|
|
|
start script
|
|
|
|
if ! ${glibc}/bin/getent group ${group} > /dev/null; then
|
|
${pwdutils}/sbin/groupadd ${group}
|
|
fi
|
|
|
|
${samba}/sbin/nmbd -D &
|
|
${samba}/sbin/smbd -D &
|
|
${samba}/sbin/winbindd -B &
|
|
|
|
end script
|
|
|
|
respawn ${samba}/sbin/nmbd -D &; ${samba}/sbin/smbd -D &; ${samba}/sbin/winbindd -B &
|
|
|
|
";
|
|
|
|
}
|