Add support for the Avahi daemon.
The daemon starts correctly but, for some reason, clients fail to connect to it. svn path=/nixos/trunk/; revision=10999
This commit is contained in:
parent
ad1b5aca82
commit
43a4353c67
@ -11,6 +11,8 @@
|
|||||||
vsftpd = 7;
|
vsftpd = 7;
|
||||||
ftp = 8;
|
ftp = 8;
|
||||||
bitlbee = 9;
|
bitlbee = 9;
|
||||||
|
avahi = 10;
|
||||||
|
|
||||||
nixbld = 30000; # start of range of uids
|
nixbld = 30000; # start of range of uids
|
||||||
nobody = 65534;
|
nobody = 65534;
|
||||||
};
|
};
|
||||||
@ -21,7 +23,9 @@
|
|||||||
haldaemon = 5;
|
haldaemon = 5;
|
||||||
vsftpd = 7;
|
vsftpd = 7;
|
||||||
ftp = 8;
|
ftp = 8;
|
||||||
|
avahi = 10;
|
||||||
audio = 17;
|
audio = 17;
|
||||||
|
|
||||||
users = 100;
|
users = 100;
|
||||||
nixbld = 30000;
|
nixbld = 30000;
|
||||||
nogroup = 65534;
|
nogroup = 65534;
|
||||||
|
@ -914,12 +914,57 @@
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
avahi = {
|
||||||
|
|
||||||
|
enable = mkOption {
|
||||||
|
default = false;
|
||||||
|
description = ''
|
||||||
|
Whether to run the Avahi daemon, which allows Avahi clients
|
||||||
|
to use Avahi's service discovery facilities and also allows
|
||||||
|
the local machine to advertise its presence and services
|
||||||
|
(through the mDNS responder implemented by `avahi-daemon').
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
hostName = mkOption {
|
||||||
|
default = "nixos"; # XXX: Would be nice to use `networking.hostName'.
|
||||||
|
description = ''Host name advertised on the LAN.'';
|
||||||
|
};
|
||||||
|
|
||||||
|
browseDomains = mkOption {
|
||||||
|
default = [ "0pointer.de" "zeroconf.org" ];
|
||||||
|
description = ''
|
||||||
|
List of non-local DNS domains to be browsed.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
ipv4 = mkOption {
|
||||||
|
default = true;
|
||||||
|
description = ''Whether to use IPv4'';
|
||||||
|
};
|
||||||
|
|
||||||
|
ipv6 = mkOption {
|
||||||
|
default = false;
|
||||||
|
description = ''Whether to use IPv6'';
|
||||||
|
};
|
||||||
|
|
||||||
|
wideArea = mkOption {
|
||||||
|
default = true;
|
||||||
|
description = ''Whether to enable wide-area service discovery.'';
|
||||||
|
};
|
||||||
|
|
||||||
|
publishing = mkOption {
|
||||||
|
default = true;
|
||||||
|
description = ''Whether to allow publishing.'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
bitlbee = {
|
bitlbee = {
|
||||||
|
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
description = ''
|
description = ''
|
||||||
Whether the run the BitlBee IRC to other chat network gateway.
|
Whether to run the BitlBee IRC to other chat network gateway.
|
||||||
Running it allows you to access the MSN, Jabber, Yahoo! and ICQ chat
|
Running it allows you to access the MSN, Jabber, Yahoo! and ICQ chat
|
||||||
networks via an IRC client.
|
networks via an IRC client.
|
||||||
'';
|
'';
|
||||||
|
44
upstart-jobs/avahi-daemon.nix
Normal file
44
upstart-jobs/avahi-daemon.nix
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
{avahi, config, writeText, lib}:
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
avahiDaemonConf = with config; writeText "avahi-daemon.conf" ''
|
||||||
|
[server]
|
||||||
|
host-name=${hostName}
|
||||||
|
browse-domains=${lib.concatStringsSep ", " browseDomains}
|
||||||
|
use-ipv4=${if ipv4 then "yes" else "no"}
|
||||||
|
use-ipv6=${if ipv6 then "yes" else "no"}
|
||||||
|
|
||||||
|
[wide-area]
|
||||||
|
enable-wide-area=${if wideArea then "yes" else "no"}
|
||||||
|
|
||||||
|
[publish]
|
||||||
|
disable-publishing=${if publishing then "no" else "yes"}
|
||||||
|
'';
|
||||||
|
|
||||||
|
avahiUid = (import ../system/ids.nix).uids.avahi;
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
name = "avahi-daemon";
|
||||||
|
|
||||||
|
users = [
|
||||||
|
{ name = "avahi";
|
||||||
|
uid = (import ../system/ids.nix).uids.avahi;
|
||||||
|
description = "`avahi-daemon' privilege separation user";
|
||||||
|
home = "/var/empty";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
job = ''
|
||||||
|
start on startup
|
||||||
|
stop on shutdown
|
||||||
|
respawn
|
||||||
|
script
|
||||||
|
export PATH="${avahi}/bin:${avahi}/sbin:$PATH"
|
||||||
|
exec ${avahi}/sbin/avahi-daemon --daemonize -f "${avahiDaemonConf}"
|
||||||
|
end script
|
||||||
|
'';
|
||||||
|
|
||||||
|
}
|
@ -157,6 +157,13 @@ let
|
|||||||
servers = config.services.ntp.servers;
|
servers = config.services.ntp.servers;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
# Avahi daemon.
|
||||||
|
++ optional config.services.avahi.enable
|
||||||
|
(import ../upstart-jobs/avahi-daemon.nix {
|
||||||
|
inherit (pkgs) avahi writeText lib;
|
||||||
|
config = config.services.avahi;
|
||||||
|
})
|
||||||
|
|
||||||
# X server.
|
# X server.
|
||||||
++ optional config.services.xserver.enable
|
++ optional config.services.xserver.enable
|
||||||
(import ../upstart-jobs/xserver.nix {
|
(import ../upstart-jobs/xserver.nix {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user