2012-03-21 20:37:37 +00:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
|
|
with pkgs.lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
netconfigFile = {
|
|
|
|
target = "netconfig";
|
|
|
|
source = pkgs.writeText "netconfig" ''
|
|
|
|
#
|
|
|
|
# The network configuration file. This file is currently only used in
|
|
|
|
# conjunction with the TI-RPC code in the libtirpc library.
|
|
|
|
#
|
|
|
|
# Entries consist of:
|
|
|
|
#
|
|
|
|
# <network_id> <semantics> <flags> <protofamily> <protoname> \
|
|
|
|
# <device> <nametoaddr_libs>
|
|
|
|
#
|
|
|
|
# The <device> and <nametoaddr_libs> fields are always empty in this
|
|
|
|
# implementation.
|
|
|
|
#
|
|
|
|
udp tpi_clts v inet udp - -
|
|
|
|
tcp tpi_cots_ord v inet tcp - -
|
|
|
|
udp6 tpi_clts v inet6 udp - -
|
|
|
|
tcp6 tpi_cots_ord v inet6 tcp - -
|
|
|
|
rawip tpi_raw - inet - - -
|
|
|
|
local tpi_cots_ord - loopback - - -
|
|
|
|
unix tpi_cots_ord - loopback - - -
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
###### interface
|
|
|
|
|
|
|
|
options = {
|
|
|
|
|
|
|
|
services.rpcbind = {
|
|
|
|
|
|
|
|
enable = mkOption {
|
2013-10-30 16:37:45 +00:00
|
|
|
type = types.bool;
|
2012-03-21 20:37:37 +00:00
|
|
|
default = false;
|
|
|
|
description = ''
|
|
|
|
Whether to enable `rpcbind', an ONC RPC directory service
|
|
|
|
notably used by NFS and NIS, and which can be queried
|
|
|
|
using the rpcinfo(1) command. `rpcbind` is a replacement for
|
|
|
|
`portmap`.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
###### implementation
|
|
|
|
|
2013-09-26 16:04:07 +01:00
|
|
|
config = mkIf config.services.rpcbind.enable {
|
2012-03-21 20:37:37 +00:00
|
|
|
|
2012-10-24 17:10:58 +01:00
|
|
|
environment.systemPackages = [ pkgs.rpcbind ];
|
2012-03-21 20:37:37 +00:00
|
|
|
|
2012-10-24 17:10:58 +01:00
|
|
|
environment.etc = [ netconfigFile ];
|
2012-03-21 20:37:37 +00:00
|
|
|
|
2013-01-16 11:33:18 +00:00
|
|
|
systemd.services.rpcbind =
|
2012-10-24 17:10:58 +01:00
|
|
|
{ description = "ONC RPC Directory Service";
|
2012-03-21 20:37:37 +00:00
|
|
|
|
2012-10-24 17:10:58 +01:00
|
|
|
wantedBy = [ "multi-user.target" ];
|
2012-03-21 20:37:37 +00:00
|
|
|
|
2012-10-24 17:10:58 +01:00
|
|
|
requires = [ "basic.target" ];
|
|
|
|
after = [ "basic.target" ];
|
|
|
|
|
|
|
|
unitConfig.DefaultDependencies = false; # don't stop during shutdown
|
|
|
|
|
|
|
|
serviceConfig.Type = "forking";
|
|
|
|
serviceConfig.ExecStart = "@${pkgs.rpcbind}/bin/rpcbind rpcbind";
|
2012-03-21 20:37:37 +00:00
|
|
|
};
|
|
|
|
|
2013-09-26 16:04:07 +01:00
|
|
|
};
|
2012-03-21 20:37:37 +00:00
|
|
|
|
|
|
|
}
|