Skip to content

Commit

Permalink
WIP: Add services.samba.nsswins option (FIXME: not working yet!)
Browse files Browse the repository at this point in the history
This option allows for seamless WINS/NetBIOS name lookup, using
nsswitch.
  • Loading branch information
bjornfor committed Sep 2, 2013
1 parent f2523c0 commit 6922607
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/config/nsswitch.nix
Expand Up @@ -28,6 +28,7 @@ let
};

inherit (config.services.avahi) nssmdns;
inherit (config.services.samba) nsswins;

in

Expand All @@ -43,7 +44,7 @@ in
passwd: files ldap
group: files ldap
shadow: files ldap
hosts: files ${optionalString nssmdns "mdns_minimal [NOTFOUND=return]"} dns ${optionalString nssmdns "mdns"} myhostname
hosts: files ${optionalString nssmdns "mdns_minimal [NOTFOUND=return]"} dns ${optionalString nssmdns "mdns"} ${optionalString nsswins "wins"} myhostname
networks: files dns
ethers: files
services: files
Expand Down
11 changes: 11 additions & 0 deletions modules/services/network-filesystems/samba.nix
Expand Up @@ -170,6 +170,15 @@ in
example = "share";
};

nsswins = mkOption {
default = true; # FIXME: just for debug
description = ''
Whether to enable the WINS NSS (Name Service Switch) plug-in.
Enabling it allows applications to resolve NetBIOS names (a.k.a.
Windows machine names) by transparently querying the winbindd daemon.
'';
};

};

};
Expand All @@ -196,6 +205,8 @@ in

users.extraGroups.smbguest.gid = config.ids.uids.smbguest;

system.nssModules = optional cfg.nsswins samba;

systemd = {
targets.samba = {
description = "Samba server";
Expand Down

0 comments on commit 6922607

Please sign in to comment.