Convert "samba"

svn path=/nixos/branches/fix-style/; revision=14386
This commit is contained in:
Marc Weber 2009-03-06 12:26:50 +00:00
parent e0240ddf3d
commit e6144b4763
3 changed files with 69 additions and 52 deletions

View File

@ -479,18 +479,6 @@ in
};
samba = {
enable = mkOption {
default = false;
description = "
Whether to enable the samba server. (to communicate with, and provide windows shares)
";
};
};
ircdHybrid = {
enable = mkOption {
@ -983,6 +971,7 @@ in
(import ../upstart-jobs/vsftpd.nix)
(import ../upstart-jobs/cupsd.nix) # CUPS printing daemon
(import ../upstart-jobs/udev.nix) # The udev daemon creates devices nodes and runs programs when hardware events occur.
(import ../upstart-jobs/samba.nix) # TODO: doesn't start here (?)
# nix
(import ../upstart-jobs/nix.nix) # nix options and daemon

View File

@ -149,13 +149,6 @@ let
inherit config pkgs;
})
# Samba service.
++ optional config.services.samba.enable
(import ../upstart-jobs/samba.nix {
inherit pkgs;
inherit (pkgs) glibc samba;
})
# X Font Server
++ optional config.services.xfs.enable
(import ../upstart-jobs/xfs.nix {

View File

@ -1,4 +1,26 @@
{pkgs, samba, glibc}:
{pkgs, config, ...}:
###### interface
let
inherit (pkgs.lib) mkOption mkIf;
options = {
services = {
samba = {
enable = mkOption {
default = false;
description = "
Whether to enable the samba server. (to communicate with, and provide windows shares)
";
};
};
};
};
in
###### implementation
let
@ -7,26 +29,38 @@ let
smbConfig = ./smb.conf ;
inherit (pkgs) samba;
in
{
name = "samba";
users = [
mkIf config.services.samba.enable {
require = [
options
];
users = {
extraUsers = [
{ name = user;
description = "Samba service user";
group = group;
}
];
groups = [
extraGroups = [
{ name = group;
}
];
};
job = "
services = {
extraJobs = [{
name = "samba";
job = ''
description \"Samba Service\"
description "Samba Service"
start on network-interfaces/started
stop on network-interfaces/stop
@ -53,6 +87,7 @@ end script
respawn ${samba}/sbin/nmbd -D -s ${smbConfig} &; ${samba}/sbin/smbd -D -s ${smbConfig} &; ${samba}/sbin/winbindd -B &
";
'';
}];
};
}